本文整理汇总了C++中Property::GetParameters方法的典型用法代码示例。如果您正苦于以下问题:C++ Property::GetParameters方法的具体用法?C++ Property::GetParameters怎么用?C++ Property::GetParameters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Property
的用法示例。
在下文中一共展示了Property::GetParameters方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: VMFImport
void VMFImport()
{
Application app;
CStatus st;
Property prop;
prop = app.GetActiveSceneRoot().GetProperties().GetItem( L"VMFImportProperty" );
if (!prop.IsValid())
prop = app.GetActiveSceneRoot().AddProperty( L"VMFImportProperty" ) ;
CValueArray args(5);
args[0] = prop;
args[1] = L"";
args[2] = L"VMFImportProperty";
args[3] = (long)4;
args[4] = true;
CValue ret;
st = app.ExecuteCommand(L"InspectObj",args,ret);
if ( CStatus::OK == st ) {
//
// FileName
//
char l_szFilename[MAX_PATH];
memset ( l_szFilename,0,MAX_PATH );
Parameter parm = prop.GetParameters().GetItem(L"Filename" );
CString str = parm.GetValue();
const wchar_t * p = str.GetWideString();
wcstombs( l_szFilename, p, wcslen (p));
parm = prop.GetParameters().GetItem(L"TexturePath" );
str = parm.GetValue();
p = str.GetWideString();
wcstombs( ___gTexturePathOverride, p, wcslen (p));
//
// Bools
//
parm = prop.GetParameters().GetItem(L"UseMaterials");
g_iImportMaterials = (bool) parm.GetValue();
if (l_szFilename && strlen( l_szFilename ) > 0)
{
CMapParser p;
p.Read ( l_szFilename );
p.ConvertToSemanticLayer();
}
else
{
XSILogMessage ( L"Error - Invalid file specified", XSI::siErrorMsg );
}
}
}
示例2: OnOgreMeshExportMenu
/** Callback event when clicking the export menu option. Adds an instance of the
options dialog as a property, then uses the InspectObj XSI command to pop it up
in a modal dialog. If it wasn't cancelled, performs an export.
*/
XSI::CStatus OnOgreMeshExportMenu( XSI::CRef& in_ref )
{
Ogre::LogManager logMgr;
logMgr.createLog("OgreXSIExporter.log", true);
CString msg(L"OGRE Exporter Version ");
msg += OGRE_XSI_EXPORTER_VERSION;
LogOgreAndXSI(msg);
Application app;
CStatus st(CStatus::OK);
Property prop = app.GetActiveSceneRoot().GetProperties().GetItem(exportPropertyDialogName);
if (prop.IsValid())
{
// Check version number
CString currVersion(prop.GetParameterValue(L"version"));
if (!currVersion.IsEqualNoCase(OGRE_XSI_EXPORTER_VERSION))
{
DeleteObj(exportPropertyDialogName);
prop.ResetObject();
}
}
if (!prop.IsValid())
{
prop = app.GetActiveSceneRoot().AddProperty(exportPropertyDialogName);
prop.PutParameterValue(L"version", CString(OGRE_XSI_EXPORTER_VERSION));
}
try
{
// Popup Returns true if the command was cancelled otherwise it returns false.
CStatus ret = Popup(exportPropertyDialogName,CValue(),L"OGRE Mesh / Skeleton Export",((LONG)siModal),true);
if (ret == CStatus::OK)
{
Ogre::XsiMeshExporter meshExporter;
Ogre::XsiSkeletonExporter skelExporter;
// retrieve the parameters
Parameter param = prop.GetParameters().GetItem(L"objectName");
CString objectName = param.GetValue();
param = prop.GetParameters().GetItem( L"targetMeshFileName" );
Ogre::String meshFileName = XSItoOgre(XSI::CString(param.GetValue()));
if (meshFileName.empty())
{
OGRE_EXCEPT(Ogre::Exception::ERR_INVALIDPARAMS,
"You must supply a mesh file name",
"OGRE Exporter");
}
// fix any omission of '.mesh'
if (!Ogre::StringUtil::endsWith(meshFileName, ".mesh"))
{
meshFileName += ".mesh";
}
param = prop.GetParameters().GetItem( L"mergeSubmeshes" );
bool mergeSubmeshes = param.GetValue();
param = prop.GetParameters().GetItem( L"exportChildren" );
bool exportChildren = param.GetValue();
param = prop.GetParameters().GetItem( L"calculateEdgeLists" );
bool edgeLists = param.GetValue();
param = prop.GetParameters().GetItem( L"calculateTangents" );
bool tangents = param.GetValue();
param = prop.GetParameters().GetItem( L"tangentSemantic" );
CString tangentSemStr = param.GetValue();
Ogre::VertexElementSemantic tangentSemantic = (tangentSemStr == L"t")?
Ogre::VES_TANGENT : Ogre::VES_TEXTURE_COORDINATES;
param = prop.GetParameters().GetItem( L"tangentsSplitMirrored" );
bool tangentsSplitMirrored = param.GetValue();
param = prop.GetParameters().GetItem( L"tangentsSplitRotated" );
bool tangentsSplitRotated = param.GetValue();
param = prop.GetParameters().GetItem( L"tangentsUseParity" );
bool tangentsUseParity = param.GetValue();
param = prop.GetParameters().GetItem( L"numLodLevels" );
long numlods = (LONG)param.GetValue();
Ogre::XsiMeshExporter::LodData* lodData = 0;
if (numlods > 0)
{
param = prop.GetParameters().GetItem( L"lodDistanceIncrement" );
float distanceInc = param.GetValue();
param = prop.GetParameters().GetItem(L"lodQuota");
CString quota = param.GetValue();
param = prop.GetParameters().GetItem(L"lodReduction");
float reduction = param.GetValue();
lodData = new Ogre::XsiMeshExporter::LodData;
float currentInc = distanceInc;
for (int l = 0; l < numlods; ++l)
{
lodData->distances.push_back(currentInc);
currentInc += distanceInc;
}
lodData->quota = (quota == L"p") ?
Ogre::ProgressiveMesh::VRQ_PROPORTIONAL : Ogre::ProgressiveMesh::VRQ_CONSTANT;
if (lodData->quota == Ogre::ProgressiveMesh::VRQ_PROPORTIONAL)
lodData->reductionValue = reduction * 0.01;
else
//.........这里部分代码省略.........