本文整理汇总了C++中Property::GetParameterValue方法的典型用法代码示例。如果您正苦于以下问题:C++ Property::GetParameterValue方法的具体用法?C++ Property::GetParameterValue怎么用?C++ Property::GetParameterValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Property
的用法示例。
在下文中一共展示了Property::GetParameterValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GenerateMeshSegment
XMLElement* Mesh::GenerateMeshSegment(XMLDocument* doc, X3DObject& mesh, bool shouldExport, CString exportPath)
{
XMLElement* root = nullptr;
if (MeshIsMassPrimitive(mesh))
{
Primitives* primitive = new Primitives();
root = primitive->WritePrimitive(doc, mesh);
delete primitive;
}
else
{
root = doc->NewElement("shape");
root->SetAttribute(Constants::attrType, "ply");
root->InsertEndChild(WriteElement(doc, Constants::attrString, Constants::attrFilename, (mesh.GetFullName() + L".ply").GetAsciiString()));
XMLElement* trElement = doc->NewElement("transform");
trElement->SetAttribute(Constants::attrName, "toWorld");
root->InsertEndChild(trElement);
MATH::CTransformation transform = mesh.GetKinematics().GetGlobal().GetTransform();
trElement->InsertEndChild(WriteElementScale(doc, mesh));
trElement->InsertEndChild(WriteSubElementRotation(doc, "x", transform.GetRotX()));
trElement->InsertEndChild(WriteSubElementRotation(doc, "y", transform.GetRotY()));
trElement->InsertEndChild(WriteSubElementRotation(doc, "z", transform.GetRotZ()));
trElement->InsertEndChild(WriteElementTranslate(doc, mesh));
Mitsuba::Material* material = new Mitsuba::Material();
material->WriteMeshMaterial(doc, root, mesh);
delete material;
if (shouldExport)
{
bool isSolid = false;
bool isSubdivide = false;
LONG subLevel = 0;
Property prop;
mesh.GetPropertyFromName(L"MaSsObjectProperty", prop);
if (prop.IsValid())
{
isSolid = prop.GetParameterValue(L"isSolid");
isSubdivide = prop.GetParameterValue(L"isSubdivide");
subLevel = prop.GetParameterValue(L"subLevel");
}
if (!isSubdivide)
{
Mitsuba::ExportPLY* exportPly = new Mitsuba::ExportPLY();
exportPly->ExportPlyMeshBinary(mesh, exportPath, mesh.GetFullName() + L".ply", isSolid);
delete exportPly;
}
else
{
/*#we should subdivide this mesh and then export
#lm("We should subdivide the mesh")
subOps = ap.ApplyOp("MeshSubdivideWithCenter", mesh)
subMesh = ap.Selection(0)
subOp = subOps(0)
ap.SetValue(subOp.SubdivisionDepth, subLevel)
ap.FreezeObj(subMesh, "", "")
tM = mesh.Kinematics.Global.Transform.Matrix4
oTrans = subMesh.Kinematics.Global.Transform
tM.InvertInPlace()
oTrans.SetMatrix4(tM)
subMesh.Kinematics.Global.Transform = oTrans
ap.ResetTransform(subMesh, "siCtr", "siSRT", "siXYZ")
ExportPlyMesh02(subMesh, exportPath, mesh.FullName + ".ply")
ap.DeleteObj(subMesh)*/
}
}
}
return root;
}
示例2: getNodeType
SceneNode::nodeTypeE getNodeType(X3DObject& xObj)
{
//CString sceneRootName = Application().GetActiveSceneRoot().GetFullName();
//if( xObj.GetFullName().IsEqualNoCase(sceneRootName) ){
// return SceneNode::SCENE_ROOT;
//}
CString xObj_GetType = xObj.GetType();
if(xObj_GetType.IsEqualNoCase(L"#model")){
return SceneNode::NAMESPACE_TRANSFORM;
}
else if(xObj_GetType.IsEqualNoCase(L"null")){
return SceneNode::ITRANSFORM;
}
else if(xObj_GetType.IsEqualNoCase(L"bone")){
return SceneNode::ITRANSFORM;
}
else if(xObj_GetType.IsEqualNoCase(L"camera"))
{
return SceneNode::CAMERA;
}
else if(xObj_GetType.IsEqualNoCase(L"polymsh")){
Property geomProp;
xObj.GetPropertyFromName(L"geomapprox",geomProp);
LONG subDivLevel = geomProp.GetParameterValue(L"gapproxmordrsl");
if(subDivLevel > 0){
return SceneNode::SUBD;
}
else{
return SceneNode::POLYMESH;
}
}
else if(xObj_GetType.IsEqualNoCase(L"surfmsh")){
return SceneNode::SURFACE;
}
else if(xObj_GetType.IsEqualNoCase(L"crvlist"))
{
return SceneNode::CURVES;
}
else if(xObj_GetType.IsEqualNoCase(L"hair"))
{
return SceneNode::CURVES;
}
else if(xObj_GetType.IsEqualNoCase(L"pointcloud"))
{
ICEAttribute strandPosition = xObj.GetActivePrimitive().GetGeometry().GetICEAttributeFromName(L"StrandPosition");
if(strandPosition.IsDefined() && strandPosition.IsValid()){
return SceneNode::CURVES;
}
else{
return SceneNode::PARTICLES;
}
}
//ESS_LOG_WARNING("Unknown type of XSI node, name: "<<xObj.GetName().GetAsciiString()<<", type: "<<xObj.GetType().GetAsciiString());
//
//if(xObj_GetType.IsEqualNoCase(L"light")){
//
//}
//else if(xObj_GetType.IsEqualNoCase(L"sphere")){
//}
//else if(xObj_GetType.IsEqualNoCase(L"cube")){
//}
//else if(xObj_GetType.IsEqualNoCase(L"tetrahedron")){
//}
//else if(xObj_GetType.IsEqualNoCase(L"icosahedron")){
//}
//else if(xObj_GetType.IsEqualNoCase(L"CameraInterest")){
//}
//else if(xObj_GetType.IsEqualNoCase(L"eff")){
//}
return SceneNode::ITRANSFORM;
//return SceneNode::UNKNOWN;
}
示例3: 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
//.........这里部分代码省略.........