当前位置: 首页>>代码示例>>C++>>正文


C++ CKParameterManager类代码示例

本文整理汇总了C++中CKParameterManager的典型用法代码示例。如果您正苦于以下问题:C++ CKParameterManager类的具体用法?C++ CKParameterManager怎么用?C++ CKParameterManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CKParameterManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PluginCallback

void PluginCallback(PluginInfo::CALLBACK_REASON reason,PluginInterface* plugininterface)
{
	s_Plugininterface	= plugininterface;
	CKContext *ctx = s_Plugininterface->GetCKContext();
	switch(reason)
	{
		
		case PluginInfo::CR_LOAD:
		{
			//////////////////////////////////////////////////////////////////////////
			//

			// this attachs the custom dialog to the Configurable Information"(CGBLCI).

			CKParameterManager *pm = ctx->GetParameterManager();
			CKParameterTypeDesc *param_desc = pm->GetParameterTypeDescription(CKGUID_CGBLM_PARAMETER);
			if ( pm && param_desc )
			{

				param_desc->UICreatorFunction = ConfigurableInformationUIFunc; 
			}

        		/*	
			// this attachs the gui dialog for CKPGUID_STRING to the GBLCO_FILE_TYPE.
			CKParameterTypeDesc *param_descFType = pm->GetParameterTypeDescription(GBLCO_FILE_TYPE);
			CKParameterTypeDesc *param_descString = pm->GetParameterTypeDescription(CKPGUID_STRING);
			if ( param_descFType )
			{
				param_descFType->UICreatorFunction = param_descString->UICreatorFunction;
			}	*/

		}break;
	}
}
开发者ID:gbaumgart,项目名称:GBL_Backup,代码行数:34,代码来源:GBLMeasurementDialogCallback.cpp

示例2: ExitInstance

CKERROR ExitInstance(CKContext* context)
{
	CKParameterManager* pm = context->GetParameterManager();
	pm->UnRegisterParameterType(CKPGUID_PROJECTIONTYPE);
	pm->UnRegisterParameterType(CKPGUID_MOUSEBUTTON);
	return CK_OK;
}
开发者ID:gbaumgart,项目名称:vt,代码行数:7,代码来源:Cameras.cpp

示例3: assert

/*
*******************************************************************
* Function: GetCI()
*
* Description : Virtools loads a composition, this function will create a CI by a chunk.
* Parameters : CKParameter *parameter, rw :			the given parameter which want to be  filled
CKStateChunk *source_chunk,r :	    member variables of the CI are loaded from here
* Returns : CGBLCOError = Ok, if everything is gone fine.
*
*******************************************************************
*/
CGBLCOError
IGBLCIAccessInterface::GetCI(CGBLCI*target,CGBLCIID idCI)
{

	assert(target);
	CGBLSMStorageManager *storageManager = static_cast<CGBLSMStorageManager *>(context->GetManagerByGuid(GBLSMStorageManagerGUID));
	IGBLSMConfigurationAccess* smCIS = storageManager->GetConfigurationInterface();


	int flags  = 0 ;
	XString name,value,defaultValue,description,type;

	// get cis list 
	CGBLCOError returnValue = smCIS->RetrieveCI(&flags,&type,&value,&name,&description,&defaultValue,idCI);
	if (returnValue == CGBLCOError::EGBLCOErrorType::GBLCO_OK)
	{
		target->name = name;
		target->realValue = context->CreateCKParameterLocal("nullCI",type.Str());
		target->realValue->SetStringValue(value.Str());
		target->defaultValue = context->CreateCKParameterLocal("nullCIDF",type.Str()); 
		target->defaultValue->SetStringValue(defaultValue.Str());
		target->description = description;
		target->flags = flags;

		CKParameterManager *pm = context->GetParameterManager();
		target->type = pm->ParameterNameToGuid(type.Str());

	}
	return returnValue;
}
开发者ID:gbaumgart,项目名称:GBL_Backup,代码行数:41,代码来源:IGBLCIAccessInterface.cpp

示例4: RegisterAttributeType

//************************************
// Method:    RegisterAttributeType
// FullName:  RegisterAttributeType
// Access:    public
// Returns:   int
// Qualifier:
// Parameter: const CKBehaviorContext& behcontext
//************************************
int RegisterAttributeType(const CKBehaviorContext& behcontext)
{
	CKBehavior* beh = behcontext.Behavior;
  	CKContext* ctx = behcontext.Context;
	PhysicManager *pm = GetPMan();

	CKAttributeManager* attman = ctx->GetAttributeManager();
	CKParameterManager *pMan  = ctx->GetParameterManager();

	using namespace vtTools::BehaviorTools;

	if( beh->IsInputActive(0) )
	{
		beh->ActivateInput(0,FALSE);

		
		CKSTRING name = GetInputParameterValue<CKSTRING>(beh,bbI_Name);
		CKSTRING category = GetInputParameterValue<CKSTRING>(beh,bbI_Category);
		CKSTRING defValue = GetInputParameterValue<CKSTRING>(beh,bbI_DefValue);
		int pType = GetInputParameterValue<int>(beh,bbI_PType);
		CK_CLASSID classId = GetInputParameterValue<CK_CLASSID>(beh,bbI_Class);

		int attFlags = 0 ;
		int user = GetInputParameterValue<int>(beh,bbI_User);
		int save = GetInputParameterValue<int>(beh,bbI_Save);

		if(user)
			attFlags|=CK_ATTRIBUT_USER;

		if(save)
			attFlags|=CK_ATTRIBUT_TOSAVE;

		attFlags|=CK_ATTRIBUT_CAN_DELETE;

		CKAttributeType aIType = attman->GetAttributeTypeByName(name);
		if (aIType!=-1)
		{
			beh->ActivateOutput(1);
		}

		int att =  attman->RegisterNewAttributeType(name,pMan->ParameterTypeToGuid(pType),classId,(CK_ATTRIBUT_FLAGS)attFlags);

		if (strlen(category))
		{
			attman->AddCategory(category);
			attman->SetAttributeCategory(att,category);
		}
		if (strlen(defValue))
		{
			attman->SetAttributeDefaultValue(att,defValue);
		}

	}
	pm->populateAttributeFunctions();
	pm->_RegisterAttributeCallbacks();

	beh->ActivateOutput(0);
	return 0;
}
开发者ID:gbaumgart,项目名称:vt,代码行数:67,代码来源:xRegisterAttributeType.cpp

示例5: Release

CKERROR CGBLLGLogControllerMgr::Release( CKContext* context )
{
    // Unregister our custom types  
	CKParameterManager* parameterManager = context->GetParameterManager();

	parameterManager->UnRegisterParameterType(GUID_EGBLLGDATATTYPE);

    return CK_OK;
}
开发者ID:gbaumgart,项目名称:GBL_Backup,代码行数:9,代码来源:GBLLGLogControllerMgr.cpp

示例6: RetrieveCICB

/*
*******************************************************************
* Function: int RetrieveCICB( const CKBehaviorContext& behaviorContext )
*
* Description : The Behavior Callback function is called by Virtools when various events happen 
*               in the life of a BuildingBlock. Exactly which events trigger a call to the 
*               Behavior Callback function is defined in the Behavior Prototype, along with the 
*               declaration of the function pointer 
*
* Parameters :
*    behaviourContext    r   Behavior context reference, which gives 
*                            access to frequently used global objects 
*                            ( context, level, manager, etc... )
*
* Returns : int, The return value of the callback function should be one of the CK_BEHAVIOR_RETURN values.
*
*******************************************************************
*/
CKERROR RetrieveCICB(const CKBehaviorContext& behcontext)
{
	/************************************************************************/
	/*  collecting data :													*/
	/*  																	*/
	CKBehavior *beh = behcontext.Behavior;
	CKContext* ctx = beh->GetCKContext();
	CKParameterManager *pm = static_cast<CKParameterManager*>(ctx->GetParameterManager());
	/************************************************************************/
	/*	process virtools callbacks		:																			*/
	/*  																														*/

	switch(behcontext.CallbackMessage)
	{
	
		
		case CKM_BEHAVIOREDITED:
		case CKM_BEHAVIORSETTINGSEDITED:
		{
	
			assert(beh && ctx);
			BOOL getAsString,outputAttriubtes = false;
			beh->GetLocalParameterValue(BEH_SETTINGS_GET_AS_STRING,&getAsString);
			beh->GetLocalParameterValue(BEH_SETTINGS_GET_CUSTOM_ATTRIBUTES,&outputAttriubtes);
	       

			//////////////////////////////////////////////////////////////////////////
			// get ci by string
			if(getAsString)
			{
				CKParameterOut* ciValue = beh->GetOutputParameter(0);
				ciValue->SetType(pm->ParameterGuidToType(CKPGUID_STRING));
			}
			
			if(outputAttriubtes)
			{
				beh->CreateOutputParameter("Default Value",CKPGUID_STRING);
                beh->CreateOutputParameter("Unique name",CKPGUID_STRING);                
				beh->CreateOutputParameter("Description",CKPGUID_STRING);
				beh->CreateOutputParameter("Runtime flags",CIPRTFLAGSGUID);
				beh->CreateOutputParameter("Type",CKPGUID_PARAMETERTYPE);

			}

			int p_count  =  beh->GetOutputParameterCount();

			while(   (outputAttriubtes ? BEH_OUT_MAX_COUNT : BEH_OUT_MIN_COUNT )   < p_count )
			{ 
				CKDestroyObject( beh->RemoveOutputParameter( --p_count) );
			}
		
			
			
		}
	}
	return CKBR_OK;
}
开发者ID:gbaumgart,项目名称:GBL_Backup,代码行数:75,代码来源:GBLCIRetrieveCI.cpp

示例7: Init

CKERROR CGBLLGLogControllerMgr::Init( CKContext* context )
{  
    // Register new custom types:
	CKParameterManager* parameterManager = context->GetParameterManager();

	CKERROR err = parameterManager->RegisterNewEnum(GUID_EGBLLGDATATTYPE,"EGBLLGDataType","String=0,Object=1");
    assert(err == CK_OK);

    return CK_OK;
}
开发者ID:gbaumgart,项目名称:GBL_Backup,代码行数:10,代码来源:GBLLGLogControllerMgr.cpp

示例8: InitInstance

CKERROR InitInstance(CKContext* context)
{
	CKParameterManager* pm = context->GetParameterManager();
	pm->RegisterNewEnum( CKPGUID_PROJECTIONTYPE,"Projection Mode","Perspective=1,Orthographic=2" );

	// Mouse Camera Orbit
	#define CKPGUID_MOUSEBUTTON CKGUID(0x1ff24d5a,0x122f2c1f)
	pm->RegisterNewEnum(CKPGUID_MOUSEBUTTON,"Mouse Button","Left=0,Middle=2,Right=1" );

	return CK_OK;
}
开发者ID:gbaumgart,项目名称:vt,代码行数:11,代码来源:Cameras.cpp

示例9: ExitInstance

/*
 *******************************************************************
 * Function: CKERROR ExitInstance( CKContext* theContext )
 *
 * Description : This function will only be called if the dll is 
 *               unloaded explicitely by a user in Virtools Dev interface
 *               Otherwise the manager destructor will be called by Virtools 
 *               runtime directly.
 *		
 * Paramters : CKContext* theContext
 *    
 * Returns : CKERROR
 *
 *******************************************************************
 */
CKERROR ExitInstance(CKContext* context)
{
    // Unregister our custom types  
	CKParameterManager* parameterManager = context->GetParameterManager();

	parameterManager->UnRegisterParameterType(CKGUID_GBLLISTBOXSELECTIONTYPE);
	parameterManager->UnRegisterParameterType(CKGUID_GBLFILESYSTEMBROWSEMODE);
	parameterManager->UnRegisterParameterType(CKGUID_GBLTEXTEDITEDITMODE);

    return CK_OK;
}
开发者ID:gbaumgart,项目名称:GBL_Backup,代码行数:26,代码来源:GBLUIWidgets.cpp

示例10: Init

CKERROR CGBLCommandControllerMgr::Init( CKContext* context )
{  
  CKParameterManager* parameterManager = context->GetParameterManager();
	
	if(parameterManager)
	{
		parameterManager->RegisterNewEnum	(GUID_EGBLTARGET,"EGBLFCTarget","Untargeted=0,Player=1,Team=2"); 

		CKParameterTypeDesc *descString = parameterManager->GetParameterTypeDescription(CKPGUID_STRING);
		CKParameterTypeDesc desc;

		//--- String coming from designer defined array of strings
		desc.TypeName				= "TGBLFCStringFromList";
		desc.Guid					= GUID_GBLSTRINGFROMLIST; 
		desc.DerivedFrom			= CKPGUID_STRING;
		desc.Valid					= descString->Valid;
		desc.DefaultSize			= descString->DefaultSize;
		desc.CreateDefaultFunction	= descString->CreateDefaultFunction;
		desc.DeleteFunction			= descString->DeleteFunction;
		desc.SaveLoadFunction		= descString->SaveLoadFunction;
		desc.StringFunction			= descString->StringFunction;
		desc.UICreatorFunction		= descString->UICreatorFunction;
		desc.dwParam				= descString->dwParam; 
		desc.dwFlags				= descString->dwFlags; 
		desc.Cid					= descString->Cid;
		desc.CopyFunction			= descString->CopyFunction;

		
		parameterManager->RegisterParameterType(&desc);

		//--- String that is a filenames
		desc.TypeName				= "TGBLFCFile";
		desc.Guid					= GUID_GBLFILE; 
		desc.DerivedFrom			= CKPGUID_STRING;
		desc.Valid					= descString->Valid;
		desc.DefaultSize			= descString->DefaultSize;
		desc.CreateDefaultFunction	= descString->CreateDefaultFunction;
		desc.DeleteFunction			= descString->DeleteFunction;
		desc.SaveLoadFunction		= descString->SaveLoadFunction;
		desc.StringFunction			= descString->StringFunction;
		desc.UICreatorFunction		= descString->UICreatorFunction;
		desc.dwParam				= descString->dwParam; 
		desc.dwFlags				= descString->dwFlags; 
		desc.Cid					= descString->Cid;
		desc.CopyFunction			= descString->CopyFunction;

		
		parameterManager->RegisterParameterType(&desc);
	}


	return CK_OK;
}
开发者ID:gbaumgart,项目名称:GBL_Backup,代码行数:53,代码来源:GBLCommandControllerMgr.cpp

示例11: PluginCallback

void PluginCallback(PluginInfo::CALLBACK_REASON reason,PluginInterface* plugininterface)
{
	s_Plugininterface	= plugininterface;
	CKContext *ctx = s_Plugininterface->GetCKContext();

	//Logger::ShowDebugMessage(ctx,Logger::ELOGERROR,"notif");

	/*
	switch(plugininterface->GetLastNotification()->messageID)
	{

	//	Logger::ShowDebugMessage(ctx,Logger::ELOGERROR,"notif");
		//CUIK_NOTIFICATION_PRESEQUENCEDELETED

	}				 */

	switch(reason)
	{


		
		
		case PluginInfo::CR_LOAD:
		{
			//////////////////////////////////////////////////////////////////////////
			//

			// this attachs the custom dialog to the Configurable Information"(CGBLCI).

			CKParameterManager *pm = ctx->GetParameterManager();
			CKParameterTypeDesc *param_desc = pm->GetParameterTypeDescription(CIPARAMETERGUID);
			if ( pm && param_desc )
			{

				param_desc->UICreatorFunction = ConfigurableInformationUIFunc; 
			}

        			
			// this attachs the gui dialog for CKPGUID_STRING to the GBLCO_FILE_TYPE.
			CKParameterTypeDesc *param_descFType = pm->GetParameterTypeDescription(GBLCO_FILE_TYPE);
			CKParameterTypeDesc *param_descString = pm->GetParameterTypeDescription(CKPGUID_STRING);
			if ( param_descFType )
			{
				param_descFType->UICreatorFunction = param_descString->UICreatorFunction;
			}	

		}break;
	}
}
开发者ID:gbaumgart,项目名称:GBL_Backup,代码行数:49,代码来源:GBLCustomisationDialogsCallback.cpp

示例12: Release

CKERROR CGBLCommandControllerMgr::Release( CKContext* context )
{
 // This function will only be called if the dll is unloaded explicitely 
	// by a user in Virtools Dev interface
	// Otherwise the manager destructor will be called by Virtools runtime directly
  
	// Unregister our custom types  
	CKParameterManager* parameterManager = context->GetParameterManager();

	parameterManager->UnRegisterParameterType(GUID_EGBLTARGET);

	parameterManager->UnRegisterParameterType(GUID_GBLSTRINGFROMLIST);

	parameterManager->UnRegisterParameterType(GUID_GBLFILE);
	
	return CK_OK;
}
开发者ID:gbaumgart,项目名称:GBL_Backup,代码行数:17,代码来源:GBLCommandControllerMgr.cpp

示例13: p1

/*
*******************************************************************
* Function: ParamOpParameterValidateString()
*
* Description :	This function validates a string for a correct float or an integer.

* Parameters :		context, r : The virtools context.
							p1 ( type : "String" ),r : The given string.
							p2 ( type : "Registered Parameter" ),r : The given virtools type. Used to determine whether the string contain a dot or not.
							res ( type : "Integer" ), w : The result of the validation.
* Returns : void
*******************************************************************
*/
void ParamOpParameterValidateString(CKContext* context, CKParameterOut* res, CKParameterIn* p1, CKParameterIn* p2)
{
    assert(context && p1 && p2 && res );

    //get the string which want to be validate
    CKSTRING stringValue =  GBLCommon::ParameterTools::GetParameterAsString(p1->GetRealSource());

    //get the supertype of the parameter type :
    CKParameterManager *pm = static_cast<CKParameterManager *>(context->GetParameterManager());
    CKParameterType parameterType =0;
    p2->GetValue(&parameterType);

    using namespace GBLCommon::enumerations;
    using namespace GBLCommon::ParameterTools;
    CO_EGBL_VirtoolsSuperType superType = GetVirtoolsSuperType(context,pm->ParameterTypeToGuid(parameterType) );

    int sscanf_result= GBLCommon::ParameterTools::IsNumeric(stringValue,superType);

    res->SetValue(&sscanf_result);
}
开发者ID:gbaumgart,项目名称:GBL_Backup,代码行数:33,代码来源:GBLCommonParameterOperations.cpp

示例14: IsValidStruct

/*
	*******************************************************************
	* Function: IsValidStruct()
	*
	* Description : Like TypeIsSerializable, even checks a custom virtools structure, recursive.
	*
	* Parameters :		CKContext *ctx,r : the virtools context
								CKGUID type,r : the type to check

	* Returns : bool
	*
	*******************************************************************
*/ 
bool 
vtTools::ParameterTools::
IsValidStruct(CKContext *ctx,CKGUID type)
{

	assert(ctx);

	CKParameterManager* pm	= ctx->GetParameterManager();
	CKStructStruct *data		= pm->GetStructDescByType(pm->ParameterGuidToType(type));

	bool result = true;

	if (data) 
		for (int i=0;i<data->NbData;++i)
			if(vtTools::ParameterTools::TypeIsSerializable(ctx,pm->ParameterGuidToType(data->GetSubParamGuid(i))))
				continue;
			else
				result = false;
	return result;
}
开发者ID:,项目名称:,代码行数:33,代码来源:

示例15: GetContext

void PhysicManager::_RegisterBodyParameterFunctions()
{
	return;

	CKContext* ctx = GetContext();

	CKParameterManager *pm = ctx->GetParameterManager();
	CKParameterTypeDesc *param_desc = pm->GetParameterTypeDescription(VTF_PHYSIC_BODY_COMMON_SETTINGS);
	if( !param_desc ) return;
	if (param_desc->CreateDefaultFunction!=0)
	{
		xLogger::xLog(ELOGERROR,E_LI_AGEIA,"has function");
		bodyCreateFuncOld = param_desc->CreateDefaultFunction;
		param_desc->CreateDefaultFunction = (CK_PARAMETERCREATEDEFAULTFUNCTION)bodyDefaultFunctionMerged;
	}
	
	//param_desc->UICreatorFunction = CKActorUIFunc;
		//param_desc->UICreatorFunction = CKDoubleUIFunc;


}
开发者ID:gbaumgart,项目名称:vt,代码行数:21,代码来源:PhysicManagerVTRegisterBodyParameters.cpp


注:本文中的CKParameterManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。