예제 #1
0
파일: sini.cpp 프로젝트: ShrewdSpirit/Sini
	void INI::AddProperty(std::string key, std::string value)
	{
		if (sections.size() == 0)
			globalProperties.push_back(Property(key, value));
		else
			sections.back().properties.push_back(Property(key, value));
	}
예제 #2
0
 void Armor::onStateChange(GameObjectState oldState, GameObjectState newState)
 {
     if (oldState != newState)
     {
         if (newState == GOS_READY)
         {
             if (getOwner())
             {
                 mRsEffect = EffectFactoryManager::getSingleton().createEffect(
                     "Ruestung");
                 if(mRsEffect == NULL)
                     return;
                 mRsEffect->setProperty(Armor::PROPERTY_G_BE, Property(mGBE));
                 mRsEffect->setProperty(Armor::PROPERTY_G_RS, Property(mGRS));
                 getOwner()->addEffect(mRsEffect);
             }
         }
         else if (oldState == GOS_READY)
         {
             if (getOwner())
             {
                 if(mRsEffect == NULL)
                     return;
                 getOwner()->removeEffect(mRsEffect);
                 delete mRsEffect;
             }
         }
     }
 }
AnimationPtr ModelActorFactory::CreateAnimation(
    Actor& rootActor,
    const ModelAnimationMap* animationData,
    AlphaFunction alpha,
    float durationSeconds)
{
    DALI_LOG_TRACE_METHOD(Debug::Filter::gModel);

    AnimationPtr animation(Animation::New(durationSeconds));
    animation->SetDefaultAlphaFunction(alpha);

    for(EntityAnimatorMapIter it = animationData->animators.begin(); it != animationData->animators.end(); ++it)
    {
        const EntityAnimatorMap& entityAnimator(*it);

        // find actor for this animator
        ActorPtr animatedActor = rootActor.FindChildByName(entityAnimator.GetEntityName());
        if (!animatedActor)
        {
            // If we can't find the actor, it may not have been instantiated, may
            // be a sibling or parent of rootActor or may have been removed.
            continue;
        }

        Dali::Actor targetActor(animatedActor.Get());

        Dali::KeyFrames posKFHandle = entityAnimator.GetPositionKeyFrames();
        if(posKFHandle)
        {
            const KeyFrames& positionKeyFrames = GetImplementation(posKFHandle);
            if(positionKeyFrames.GetKeyFramesBase()->GetNumberOfKeyFrames() > 0)
            {
                animation->AnimateBetween(Property(targetActor, Dali::Actor::POSITION),
                                          positionKeyFrames, alpha, durationSeconds);
            }
        }

        Dali::KeyFrames scaleKFHandle = entityAnimator.GetScaleKeyFrames();
        if(scaleKFHandle)
        {
            const KeyFrames& scaleKeyFrames    = GetImplementation(scaleKFHandle);
            if(scaleKeyFrames.GetKeyFramesBase()->GetNumberOfKeyFrames() > 0)
            {
                animation->AnimateBetween(Property(targetActor, Dali::Actor::SCALE),    scaleKeyFrames, alpha, durationSeconds);
            }
        }

        Dali::KeyFrames rotationKFHandle = entityAnimator.GetRotationKeyFrames();
        if(rotationKFHandle)
        {
            const KeyFrames& rotationKeyFrames = GetImplementation(rotationKFHandle);
            if(rotationKeyFrames.GetKeyFramesBase()->GetNumberOfKeyFrames() > 0)
            {
                animation->AnimateBetween(Property(targetActor, Dali::Actor::ROTATION), rotationKeyFrames, alpha, durationSeconds);
            }
        }
    }
    return animation;
}
예제 #4
0
void Renderer::addNextMesh() {
    std::string model_filename = current_mesh->path().string();
    std::cout << "selecting model: " << model_filename << std::endl;
    config.GetScene().Parse(
            Property("scene.shapes.subject.type")("mesh") <<
            Property("scene.shapes.subject.ply")(model_filename));
    config.GetScene().RemoveUnusedMeshes();
}
예제 #5
0
	// 枚举所有属性,以树的形式
	void TriggerObject::enumPropertiesTree(VTProperty &properties)const
	{
		NullObject::enumPropertiesTree(properties);
		properties.push_back(Property( ID_Trigger , PT_GROUP , "触发器设置" , "触发器设置" , true , false , false));
		properties.back().addChild(Property( ID_TriggerCondition , PT_BOOL , "满足条件" , "是否已经满足条件触发这个触发器,只有当条件满足时才可以触发" , true , true , true));
		properties.back().addChild(Property( ID_TriggerOnEnterEvent , PT_STRING , "进入事件" , "当满足条件后进入触发器,就会触发这个事件" , true , true , true));
		properties.back().addChild(Property( ID_TriggerOnLeaveEvent , PT_STRING , "退出事件" , "当触发了进入事件后退出触发器,就会触发这个事件" , true , true , true));
	}
	PropertyGroupInstance SampleSensorFactory::GetSensorProperties( SampleSensor& sensor )
	{
		PropertyGroupInstance properties;
		properties.push_back( Property( sensor.sendRate ) );
		properties.push_back( Property( sensor.quality_factor ) );

		return properties;
	}
예제 #7
0
    void constraints() {
      function_requires< ReadablePropertyGraphConcept<G, X, Property> >();
      function_requires< ReadWritePropertyMapConcept<Map, X> >();

      Map pmap = get(Property(), g);
      pval = get(Property(), g, x);
      put(Property(), g, x, pval);
      ignore_unused_variable_warning(pmap);
    }
예제 #8
0
void
CannaJRKanji::install_properties (void)
{
    m_properties.clear ();

    Property prop;

    prop = Property (SCIM_PROP_INPUT_MODE,
                     _("Input mode"), String (""),
                     _("Input mode"));
    m_properties.push_back (prop);

    prop = Property (SCIM_PROP_INPUT_MODE_OFF,
                     _("Off"), String (""),
                     _("Off"));
    m_properties.push_back (prop);

    prop = Property (SCIM_PROP_INPUT_MODE_HIRAGANA,
                     _("Hiragana"), String (""),
                     _("Hiragana"));
    m_properties.push_back (prop);

    prop = Property (SCIM_PROP_INPUT_MODE_KATAKANA,
                     _("Katakana"), String (""),
                     _("Katakana"));
    m_properties.push_back (prop);

    prop = Property (SCIM_PROP_INPUT_MODE_HALF_KATAKANA,
                     _("Half width katakana"), String (""),
                     _("Half width katakana"));
    m_properties.push_back (prop);

    prop = Property (SCIM_PROP_INPUT_MODE_ALPHABET,
                     _("Alphabet"), String (""),
                     _("Alphabet"));
    m_properties.push_back (prop);

    prop = Property (SCIM_PROP_INPUT_MODE_WIDE_ALPHABET,
                     _("Wide alphabet"), String (""),
                     _("Wide alphabet"));
    m_properties.push_back (prop);

    prop = Property (SCIM_PROP_INPUT_MODE_KIGO,
                     _("Symbols"), String (""),
                     _("Search a symbol"));
    m_properties.push_back (prop);

    prop = Property (SCIM_PROP_INPUT_MODE_HEX,
                     _("Hex"), String (""),
                     _("Search a kanji by hex"));
    m_properties.push_back (prop);

    prop = Property (SCIM_PROP_INPUT_MODE_BUSHU,
                     _("Bushu"), String (""),
                     _("Search a kanji by bushu"));
    m_properties.push_back (prop);
}
예제 #9
0
QList<PipelineComponent::Property> CsvSourceComponent::getProperties()
{
    QList<Property> l;
    l << Property(this, "Spectrum", "Sets the spectrum", spectrum);
    l << Property(this, "Step size", "Specifies the step size", stepSize, 0.0,  10000.0, "m");
    l << Property(this, "Intensity", "Holds the path to the CSV file containing the intensity distribution. Can NOT be empty!", QFile(intensityDataPath));
    l << Property(this, "Phase", "Holds the path to the CSV file containing  the phase distribution. Can be empty!", QFile(phaseDataPath));
    l << Property(this, "CSV separator", "Specifies the CSV separator", csvSeparator);
    return l;
}
예제 #10
0
TBool CUPnPArgument::Validate(const RStringPool& aStringPool, const TStringTable& aStringTable ) const
	{
	TBool result=EFalse;
	if(	(Property(aStringPool.String(UPNPDESCRIPTIONXMLTAGS::EName, aStringTable)).Length()!=0) &&
			(Property(aStringPool.String(UPNPDESCRIPTIONXMLTAGS::EArgumentDirection, aStringTable)).Length()!=0) &&	
			(Property(aStringPool.String(UPNPDESCRIPTIONXMLTAGS::ERelatedStateVar, aStringTable)).Length()!=0))
				result = ETrue;
	
	return result;
	
	}
예제 #11
0
void Test_ormtool::createSqlScriptForTable()
{
    SqlScriptBuilder builder;
    builder.setDriverName("QMYSQL");
    builder.fillTableTypesMySql();
    Model model("Table");
    model.addProperty(Property("QString", "name"));
    model.addProperty(Property("int", "number"));
    QCOMPARE(builder.createSqlScriptForTableMySql(model).simplified(), QString("CREATE TABLE Table(id BIGINT AUTO_INCREMENT, name TEXT, number INT, "
                                                             "PRIMARY KEY(id));").simplified());
}
예제 #12
0
  void DatabaseIO::create_group(EntityType type, const std::string & /*type_name*/,
                                const std::vector<std::string> &group_spec,
                                const SideSet * /*set_type*/)
  {
    // Not generalized yet... This only works for T == SideSet
    if (type != SIDESET) {
      return;
    }

    int64_t entity_count = 0;
    int64_t df_count     = 0;

    // Create the new set...
    auto new_set = new SideSet(this, group_spec[0]);

    get_region()->add(new_set);

    // Find the member SideSets...
    for (size_t i = 1; i < group_spec.size(); i++) {
      SideSet *set = get_region()->get_sideset(group_spec[i]);
      if (set != nullptr) {
        SideBlockContainer side_blocks = set->get_side_blocks();
        for (auto &sbold : side_blocks) {
          size_t side_count = sbold->get_property("entity_count").get_int();
          auto   sbnew      = new SideBlock(this, sbold->name(), sbold->topology()->name(),
                                     sbold->parent_element_topology()->name(), side_count);
          int64_t id = sbold->get_property("id").get_int();
          sbnew->property_add(Property("set_offset", entity_count));
          sbnew->property_add(Property("set_df_offset", df_count));
          sbnew->property_add(Property("id", id));

          new_set->add(sbnew);

          size_t old_df_count = sbold->get_property("distribution_factor_count").get_int();
          if (old_df_count > 0) {
            std::string storage = "Real[";
            storage += Utils::to_string(sbnew->topology()->number_nodes());
            storage += "]";
            sbnew->field_add(
                Field("distribution_factors", Field::REAL, storage, Field::MESH, side_count));
          }
          entity_count += side_count;
          df_count += old_df_count;
        }
      }
      else {
        IOSS_WARNING << "WARNING: While creating the grouped surface '" << group_spec[0]
                     << "', the surface '" << group_spec[i] << "' does not exist. "
                     << "This surface will skipped and not added to the group.\n\n";
      }
    }
  }
예제 #13
0
int Vip::req_vip_daily_receive(void){
	if(vip_detail_->has_receive_daily_reward) {
		return ERROR_RECEIVED_VIP_DAILY;
	}
	const Vip_Daily_Item_Config_Vec *conf = CONFIG_CACHE_VIP->get_vip_daily_config(player_self()->vip());
	if(conf) {
		Item_Vec item_list; item_list.clear();
		Money_Add_List money_add_list; money_add_list.clear();
		uint32_t exp = 0;
		MSG_81000102 acv_msg;
		acv_msg.type = 0;
		for(Vip_Daily_Item_Config_Vec::const_iterator it = conf->begin(); it != conf->end(); ++it) {
			if(it->item_id == PT_EXP_CURRENT) {
				exp += it->num;
			} else {
				if(it->item_id > 999999) {
					Item_Detail item = Item_Detail(it->item_id, it->num, it->bind);
					item_list.push_back(item);
					Item_Basic_Info ibi;
					item.set_item_basic_info(ibi);
					acv_msg.item_info.push_back(ibi);
				} else {
					money_add_list.push_back(Money_Add_Info(Money_Type(it->item_id), it->num,Money_DM_Info(MONEY_ADD_VIP_DAILY)));
					acv_msg.property.push_back(Property(it->item_id, it->num));
				}
			}
		}
		if(!item_list.empty()) {
			int result = player_self()->pack_insert_item(PACK_T_PACKAGE_INDEX, item_list, Gain_Item_DM_Info(ITEM_GAIN_VIP_DAILY));
			if(result) {
				return result;
			}
		}
		if(!money_add_list.empty()) {
			player_self()->pack_add_money(money_add_list);
		}
		if(exp) {
			const Exp_All exp_all = player_self()->modify_experience_inter(exp, false, false, true);
			if (0 == exp_all.result) {
				acv_msg.property.push_back(Property(PT_EXP_CURRENT, exp_all.all));
				acv_msg.vip_exp = exp_all.vip_exp;
				acv_msg.world_level = player_self()->get_world_level_add();
			}
		}
		vip_detail_->has_receive_daily_reward = true;
		vip_detail_->detail_change();
		MSG_50106206 msg;
		THIS_SEND_TO_CLIENT(msg);
		THIS_SEND_TO_CLIENT(acv_msg);
	}
	return 0;
}
예제 #14
0
/** 
validation
*/
TBool CUPnPStateVariable::Validate(const RStringPool& aStringPool, const TStringTable& aStringTable ) const
	{
	TBool result=ETrue;
	// name cannot be of zero chars
	
	if(	(Property(aStringPool.String(UPNPDESCRIPTIONXMLTAGS::EName, aStringTable)).Length()!=0) &&
			(Property(aStringPool.String(UPNPDESCRIPTIONXMLTAGS::EStateVariableDataType, aStringTable)).Length()!=0) &&
			(Property(aStringPool.String(UPNPDESCRIPTIONXMLTAGS::ESendEvents, aStringTable)).Length()!=0)	)
				result = ETrue;

	
	return result;

	}
예제 #15
0
void Parser::parse_property( std::string const& tag )
{
    std::vector<Property> propertys;
    std::string::size_type pos = tag.find( ' ' );
    if( pos == std::string::npos )
    {
        on_start( tag, propertys );
        return;
    }
    std::string tag_name = tag.substr( 0, pos );

    std::string::size_type  p1 = tag.find( '=', pos + 1 );
    while( p1 != std::string::npos 
        && pos != std::string::npos )
    {
        std::string name = property_name( tag, pos, p1 );
        std::string::size_type p2 = tag.find( '\x22', p1 );//find "
        if( p2 != std::string::npos )
        {
            std::string::size_type p3 = tag.find( '\x22', p2 + 1 );
            if( p3 != std::string::npos )
            {
                std::string value( tag.substr( p2 + 1, p3 - p2 - 1 ) );
                propertys.push_back( Property( name, value ) );
                pos = tag.find( ' ', p3 );
            }
            else
                pos = tag.find( ' ', p2 );
        }
        else if( ( p2 = tag.find( '\x27', p1 ) ) != std::string::npos )//find '
        {
            std::string::size_type p3 = tag.find( '\x27', p2 + 1 );
            if( p3 != std::string::npos )
            {
                std::string value( tag.substr( p2 + 1, p3 - p2 - 1 ) );
                propertys.push_back( Property( name, value ) );
                pos = tag.find( ' ', p3 );
            }
            else
                pos = tag.find( ' ', p2 );
        }
        else
        {
           pos = tag.find( ' ', p1 );
        }
        p1 = tag.find( '=', pos + 1 );
    }
    on_start( tag_name, propertys );
}
예제 #16
0
 const Property Armor::getProperty(const CeGuiString &key) const
 {
     if (key == Armor::PROPERTY_G_BE)
     {
         return Property(mGBE);
     }
     else if (key == Armor::PROPERTY_G_RS)
     {
         return Property(mGRS);
     }
     else
     {
         return Item::getProperty(key);
     }
 }
 /** \brief Reverse Property. */
 Property Property::operator ~ () const
 {
     switch (PROP2DIR(_property))
     {
     case Forward:
         return Property(PROP2NODE(_property), Backward);
         break;
     case Backward:
         return Property(PROP2NODE(_property), Forward);
         break;
     default:
         return *this;
         break;
     }
 }
예제 #18
0
파일: model.cpp 프로젝트: voidcycles/void
void 
Base::Set(
    const vd::string& name, 
    const Property::ValueType& value)
{ 
    m_Properties[name] = Property(name, value); 
}
예제 #19
0
bool Properties::setString(const char* name, const char* value)
{
    if (name)
    {
        for (std::vector<Property>::iterator itr = _properties.begin(); itr != _properties.end(); ++itr)
        {
            if (itr->name == name)
            {
                // Update the first property that matches this name
                itr->value = value ? value : "";
                return true;
            }
        }

        // There is no property with this name, so add one
        _properties.push_back(Property(name, value ? value : ""));
    }
    else
    {
        // If there's a current property, set its value
        if (_propertiesItr == _properties.end())
            return false;

        _propertiesItr->value = value ? value : "";
    }

    return true;
}
예제 #20
0
void GLState::apply() const
{
    // Update the render target.
    if(currentTarget != d->target)
    {
        if(currentTarget) currentTarget->glRelease();
        currentTarget = d->target;
        if(currentTarget) currentTarget->glBind();
    }

    // Determine which properties have changed.
    BitField::Ids changed;
    if(!currentProps.size())
    {
        // Apply everything.
        changed = d->props.elementIds();
    }
    else
    {
        // Just apply the changed parts of the state.
        changed = d->props.delta(currentProps);
    }

    if(!changed.isEmpty())
    {
        d->removeRedundancies(changed);

        // Apply the changed properties.
        foreach(BitField::Id id, changed)
        {
            d->glApply(Property(id));
        }
예제 #21
0
파일: custom.cpp 프로젝트: SASfit/SASfit
void c4_CustomHandler::Set(int index_, const c4_Bytes& buf_)
{
  int colnum = _seq->PropIndex(Property().GetId());
  d4_assert(colnum >= 0);
  
  _seq->DoSet(index_, colnum, buf_);
}
int Scene_Server_Request::process_20410001(int cid, role_id_t role_id, Scene_Player *player, Block_Buffer &buf) {
	JUDGE_PLAYER_NULL(player, role_id);

	MSG_50200032 res_msg;
	res_msg.role_id = player->role_id();
	res_msg.open_type = 1;

	player->fighter_detail().property_list(res_msg.prop_value);
	Hero *hero = SCENE_PUBLIC->find_fight_hero(player->role_id());
	if (hero) {
		int hero_init_morale_type = hero->fighter_detail().init_morale.type;
		double hero_init_morale_val = hero->fighter_detail().init_morale.total();
		for (uint16_t i = 0; i < res_msg.prop_value.size(); ++i) {
			if (res_msg.prop_value[i].type == hero_init_morale_type) {
				res_msg.prop_value[i].value += hero_init_morale_val;
			}
		}
	}
	res_msg.prop_value.push_back(Property(PT_CAREER, player->career()));

	res_msg.role_name = player->role_name();/*人物姓名*/
	res_msg.gang_name = player->base_detail().gang_name;/*人物id*/
	res_msg.gender = player->base_detail().gender;/*性别(1男,2女)*/
	res_msg.gang_id = player->base_detail().gang_id;/*职业*/
	res_msg.headship = player->ganger_detail().headship;
	res_msg.avatar_vec = player->base_detail().avatar_vec;

    OBJ_SEND_TO_CLIENT(res_msg, (*player));
	return 0;
}
GPoint2 GAnimTRSNode2D::Position(const GTimeValue TimePos, const GSpaceSystem Space, GTimeInterval& ValidInterval) const {

	GProperty *tmpProp = Property("transform");

	if (!tmpProp)
		return GPoint2(0, 0);

	tmpProp = tmpProp->Property("position");
	G_ASSERT(tmpProp);
	GTimeInterval tmpValid = G_FOREVER_TIMEINTERVAL;
	GKeyValue xValue, yValue;

	// extract translation
	GProperty *xProp = tmpProp->Property("x");
	GProperty *yProp = tmpProp->Property("y");
	G_ASSERT(xProp != NULL);
	G_ASSERT(yProp != NULL);
	// build translation factor
	GError xErr = xProp->Value(xValue, tmpValid, TimePos, G_ABSOLUTE_VALUE);
	GError yErr = yProp->Value(yValue, tmpValid, TimePos, G_ABSOLUTE_VALUE);
	if (xErr != G_NO_ERROR || yErr != G_NO_ERROR)
		return GPoint2(0, 0);

	ValidInterval = tmpValid;

	// take care of father
	if (gFather && Space == G_WORLD_SPACE) {
		GPoint2 retValue(xValue.RealValue(), yValue.RealValue());
		retValue += gFather->Position(TimePos, G_WORLD_SPACE, tmpValid);
		ValidInterval &= tmpValid;
		return retValue;
	}
	return GPoint2(xValue.RealValue(), yValue.RealValue());
}
예제 #24
0
	void FKlawrBlueprintCompiler::FinishCompilingClass(UClass* InGeneratedClass)
	{
		auto Blueprint = CastChecked<UKlawrBlueprint>(Super::Blueprint);
		auto GeneratedClass = CastChecked<UKlawrBlueprintGeneratedClass>(InGeneratedClass);
		if (Blueprint && GeneratedClass)
		{
			GeneratedClass->ScriptDefinedType = Blueprint->ScriptDefinedType;
		}

		// allow classes generated from Blueprints of Klawr script components to be used in other 
		// Blueprints
		if (Super::Blueprint->ParentClass->IsChildOf(UKlawrScriptComponent::StaticClass()) &&
			(InGeneratedClass != Super::Blueprint->SkeletonGeneratedClass))
		{
			InGeneratedClass->SetMetaData(TEXT("BlueprintSpawnableComponent"), TEXT("true"));
		}

		Super::FinishCompilingClass(InGeneratedClass);
		UObject* CDO = InGeneratedClass->GetDefaultObject();

		for (TFieldIterator<UStrProperty> Property(InGeneratedClass); Property; ++Property)
		{
			if (Super::Blueprint->ParentClass->IsChildOf(UKlawrScriptComponent::StaticClass()) &&
				(InGeneratedClass != Super::Blueprint->SkeletonGeneratedClass))
			{
				Property->SetPropertyValue(Property->ContainerPtrToValuePtr<void>(CDO), FString(TEXT("")));
			}
		}

	}
GReal GAnimTRSNode2D::Rotation(const GTimeValue TimePos, const GSpaceSystem Space, GTimeInterval& ValidInterval) const {

	GProperty *tmpProp = Property("transform");

	if (!tmpProp)
		return 0;

	tmpProp = tmpProp->Property("rotation");
	G_ASSERT(tmpProp);
	GTimeInterval tmpValid = G_FOREVER_TIMEINTERVAL;
	GKeyValue tmpValue;

	GError err = tmpProp->Value(tmpValue, tmpValid, TimePos, G_ABSOLUTE_VALUE);
	if (err != G_NO_ERROR)
		return 0;

	ValidInterval = tmpValid;
	// take care of father
	if (gFather && Space == G_WORLD_SPACE) {
		GReal retValue = tmpValue.RealValue();
		retValue += gFather->Rotation(TimePos, G_WORLD_SPACE, tmpValid);
		ValidInterval &= tmpValid;
		return retValue;
	}
	return tmpValue.RealValue();
}
GVectBase<GReal, 2> GAnimTRSNode2D::Scale(const GTimeValue TimePos, const GSpaceSystem Space, GTimeInterval& ValidInterval) const {

	GProperty *tmpProp = Property("transform");

	if (!tmpProp)
		return GVector2(1, 1);

	tmpProp = tmpProp->Property("scale");
	G_ASSERT(tmpProp);
	GTimeInterval tmpValid = G_FOREVER_TIMEINTERVAL;
	GKeyValue xValue, yValue;

	// extract scale
	GProperty *xProp = tmpProp->Property("x");
	GProperty *yProp = tmpProp->Property("y");
	G_ASSERT(xProp != NULL);
	G_ASSERT(yProp != NULL);
	GError xErr = xProp->Value(xValue, tmpValid, TimePos, G_ABSOLUTE_VALUE);
	GError yErr = yProp->Value(yValue, tmpValid, TimePos, G_ABSOLUTE_VALUE);
	if (xErr != G_NO_ERROR || yErr != G_NO_ERROR)
		return GVector2(1, 1);

	ValidInterval = tmpValid;
	// take care of father
	if (gFather && Space == G_WORLD_SPACE) {
		GVectBase<GReal, 2> retValue(xValue.RealValue(), yValue.RealValue());
		retValue += gFather->Scale(TimePos, G_WORLD_SPACE, tmpValid);
		ValidInterval &= tmpValid;
		return retValue;
	}
	return GVectBase<GReal, 2>(xValue.RealValue(), yValue.RealValue());
}
GError GAnimTRSNode2D::SetScale(const GTimeValue TimePos, const GVectBase<GReal, 2>& RelScale) {

	GError err;
	GProperty *tmpProp = Property("transform");

	// this can be the case of a curve not created through a kernel
	if (!tmpProp) {
		err = G_MISSING_KERNEL;
	}
	else {
		// extract position track
		GProperty *scaleProp = tmpProp->Property("scale");
		G_ASSERT(scaleProp);

		GKeyValue tmpValue;
		tmpValue.SetTimePosition(TimePos);

		// set "x" property
		tmpProp = scaleProp->Property("x");
		G_ASSERT(tmpProp != NULL);
		tmpValue.SetValue(RelScale[G_X]);
		err = tmpProp->SetValue(tmpValue, TimePos, G_ABSOLUTE_VALUE);
		if (err != G_NO_ERROR)
			return err;
		// set "y" property
		tmpProp = scaleProp->Property("y");
		G_ASSERT(tmpProp != NULL);
		tmpValue.SetValue(RelScale[G_Y]);
		err = tmpProp->SetValue(tmpValue, TimePos, G_ABSOLUTE_VALUE);
	}
	return err;
}
// move all rotation keys by an additive offset angle (expressed in radiant)
void GAnimTRSNode2D::OffsetRotationTrack(const GReal OffsetAngle) {

	GProperty *tmpProp = Property("transform"), *rotProp;
	GUInt32 i, j;
	GKeyValue tmpKey;

	if (!tmpProp)
		return;

	rotProp = tmpProp->Property("rotation");
	G_ASSERT(rotProp != NULL);

	j = rotProp->KeysCount();
	if (j == 0) {
		tmpKey = rotProp->DefaultValue();
		tmpKey.SetValue(OffsetAngle + tmpKey.RealValue());
		rotProp->SetDefaultValue(tmpKey);
	}
	else {
		for (i = 0; i < j; ++i) {
			rotProp->Key(i, tmpKey);
			rotProp->SetValue(tmpKey.RealValue() + OffsetAngle);
			rotProp->SetKey(i, tmpKey);
		}
	}
}
예제 #29
0
void VEventComponent::readContentLine( const QString inContent )
{
    if( inContent.startsWith( "BEGIN:VALARM", Qt::CaseInsensitive ) )
    {
        m_activeComponent = IN_VALARM;
        VAlarmComponent component = VAlarmComponent();
        m_vAlarmComponents.append( component );
        return;
    }
    if( inContent.startsWith( "END:VALARM", Qt::CaseInsensitive ) )
    {
        m_activeComponent = IN_VEVENT;
        return;
    }

    if( m_activeComponent == IN_VEVENT )
    {
        Property p = Property();
        if( p.readProperty( inContent ) )
        {
            // Put DT-START first, this makes it easier to test for DT_END or DURATION
            if( p.m_type == Property::PT_DTSTART )
                m_properties.prepend( p );
            else
                m_properties.append( p );
        }
    }
    else
        m_vAlarmComponents.last().readContentLine( inContent );
}
예제 #30
0
TEST(Property_Test, null)
{
  /*
   * This is an extract of manual test code originally run from AbpCloseIe DLL entry point.
   * This code relies on an MSI database opened for installation, which we don't need to access properties.
   * We can instead use an offline session, with the database opened outside Windows Installer.
   * That session class, though, isn't written yet.
   */
  /*
   * DISABLED. Refactor into proper tests.
   */
  if (false)
  {
    // This variable was the argument to the entry point.
    MSIHANDLE sessionHandle = 0;

    // The code in the body.
    ImmediateSession session(sessionHandle, "AbpCloseIe");
    session.Log(L"Have session object");
    InstallationDatabase db(session);
    session.Log(L"Have database object");

    // Test: ensure that a property is present with its expected value. Exercises the conversion operator to String.
    session.Log(L"VersionMsi = " + Property(session, L"VersionMsi"));

    // Test: create a property dynamically from within the CA. Not sure if this can be done offline.
    Property tv(session, L"TESTVARIABLE");
    session.Log(L"TESTVARIABLE = " + tv);

    // Test: assign a new value to a property.
    session.Log(L"Setting TESTVARIABLE to 'testvalue'");
    tv = L"testvalue";
    session.Log(L"TESTVARIABLE = " + tv);
  }
}