本文整理汇总了C++中MIntArray::get方法的典型用法代码示例。如果您正苦于以下问题:C++ MIntArray::get方法的具体用法?C++ MIntArray::get怎么用?C++ MIntArray::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MIntArray
的用法示例。
在下文中一共展示了MIntArray::get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: compute
MStatus LSSolverNode::compute(const MPlug& plug, MDataBlock& data)
{
MStatus stat;
if( plug == deformed)
{
MDataHandle tetWorldMatrixData = data.inputValue(tetWorldMatrix, &returnStatus);
McheckErr(returnStatus, "Error getting tetWorldMatrix data handle\n");
MDataHandle restShapeData = data.inputValue(restShape, &returnStatus);
McheckErr(returnStatus, "Error getting step data handle\n");
MDataHandle restVerticesData = data.inputValue(restVertices, &returnStatus);
McheckErr(returnStatus, "Error getting step data handle\n");
MDataHandle restElementsData = data.inputValue(restElements, &returnStatus);
McheckErr(returnStatus, "Error getting step data handle\n");
MDataHandle selectedConstraintVertsData = data.inputValue(selectedConstraintVerts, &returnStatus);
McheckErr(returnStatus, "Error getting step data handle\n");
MDataHandle selectedForceVertsData = data.inputValue(selectedForceVerts, &returnStatus);
McheckErr(returnStatus, "Error getting step data handle\n");
MDataHandle timeData = data.inputValue(time, &returnStatus);
McheckErr(returnStatus, "Error getting step data handle\n");
MDataHandle outputMeshData = data.outputValue(deformed, &returnStatus);
McheckErr(returnStatus, "Error getting outputMesh data handle\n");
MMatrix twmat = tetWorldMatrixData.asMatrix();
MObject rs = restShapeData.asMesh();
double t = timeData.asDouble();
MDataHandle poissonRatioData = data.inputValue(poissonRatio, &returnStatus);
McheckErr(returnStatus, "Error getting poissonRatio data handle\n");
MDataHandle youngsModulusData = data.inputValue(youngsModulus, &returnStatus);
McheckErr(returnStatus, "Error getting youngsmodulus data handle\n");
MDataHandle objectDensityData = data.inputValue(objectDensity, &returnStatus);
McheckErr(returnStatus, "Error getting objectDensity data handle\n");
MDataHandle frictionData = data.inputValue(friction, &returnStatus);
McheckErr(returnStatus, "Error getting friction data handle\n");
MDataHandle restitutionData = data.inputValue(restitution, &returnStatus);
McheckErr(returnStatus, "Error getting restitution data handle\n");
MDataHandle dampingData = data.inputValue(damping, &returnStatus);
McheckErr(returnStatus, "Error getting damping data handle\n");
MDataHandle userSuppliedDtData = data.inputValue(userSuppliedDt, &returnStatus);
McheckErr(returnStatus, "Error getting user supplied dt data handle\n");
MDataHandle integrationTypeData = data.inputValue(integrationType, &returnStatus);
McheckErr(returnStatus, "Error getting user integrationTypeData\n");
MDataHandle forceModelTypeData = data.inputValue(forceModelType, &returnStatus);
McheckErr(returnStatus, "Error getting user forceModelTypeData\n");
MDataHandle forceApplicationTimeData = data.inputValue(forceApplicationTime, &returnStatus);
McheckErr(returnStatus, "Error getting user forceApplicationTime\n");
MDataHandle forceReleasedTimeData = data.inputValue(forceReleasedTime, &returnStatus);
McheckErr(returnStatus, "Error getting user forceReleasedTime\n");
MDataHandle forceIncrementTimeData = data.inputValue(forceIncrementTime, &returnStatus);
McheckErr(returnStatus, "Error getting user forceIncrementTime\n");
MDataHandle forceStartTimeData = data.inputValue(forceStartTime, &returnStatus);
McheckErr(returnStatus, "Error getting user forceStartTime\n");
MDataHandle forceStopTimeData = data.inputValue(forceStopTime, &returnStatus);
McheckErr(returnStatus, "Error getting user forceStopTime\n");
MDataHandle forceMagnitudeData = data.inputValue(forceMagnitude, &returnStatus);
McheckErr(returnStatus, "Error getting user forceIdleTime\n");
MDataHandle useSuppliedForceData = data.inputValue(useSuppliedForce, &returnStatus);
McheckErr(returnStatus, "Error getting user forceIdleTime\n");
MDataHandle useSuppliedConstraintsData = data.inputValue(useSuppliedConstraints, &returnStatus);
McheckErr(returnStatus, "Error getting user forceIdleTime\n");
MDataHandle forceDirectionData = data.inputValue(forceDirection, &returnStatus);
McheckErr(returnStatus, "Error getting user forceDirection\n");
MDataHandle contactKsData = data.inputValue(contactKs, &returnStatus);
McheckErr(returnStatus, "Error getting user forceDirection\n");
MDataHandle contactKdData = data.inputValue(contactKd, &returnStatus);
McheckErr(returnStatus, "Error getting user forceDirection\n");
MTime currentTime, maxTime;
currentTime = MAnimControl::currentTime();
maxTime = MAnimControl::maxTime();
if (currentTime == MAnimControl::minTime())
//.........这里部分代码省略.........
示例2: writeMeshStaticDataInCache
bool writeMeshStaticDataInCache(drn_writer_t * cache,
DRNTDagNode & node,
drn_scene::MeshContainer * meshContainer,
DRNTHardEdge & he, MeshExportMode mode)
{
uint32_t drnStatus = 0;
MStatus status;
MFnMesh mesh(node.dagPath);
if (mode == MESH_EXPORT_FULL_TOPOLOGY)
{
meshContainer->numPolygons = mesh.numPolygons(&status);
meshContainer->numVertices = mesh.numVertices(&status);
meshContainer->numNormals = mesh.numNormals(&status);
}
else
{
meshContainer->numPolygons = 0;
meshContainer->numVertices = 0;
meshContainer->numNormals = 0;
}
MIntArray vertexCount;
MIntArray vertexList;
MIntArray normalCount;
MIntArray normalList;
MIntArray uvCounts;
MIntArray uvIds;
mesh.getAssignedUVs(uvCounts, uvIds);
MIntArray triangleCount;
MIntArray triangleList;
MIntArray triangleNList;
MIntArray triangleUVList;
mesh.getVertices(vertexCount, vertexList);
mesh.getNormalIds(normalCount, normalList);
mesh.getTriangles(triangleCount, triangleList);
triangleNList.setLength(triangleList.length());
triangleUVList.setLength(triangleList.length());
meshContainer->numTriangles = triangleList.length() / 3;
int * vcarray = new int[vertexCount.length()];
int * vlarray = new int[vertexList.length()];
int * ncarray = new int[normalCount.length()];
int * nlarray = new int[normalList.length()];
// Triangulation
int poly_idx_offset = 0;
int tri_idx_offset = 0;
for (int i = 0; i < mesh.numPolygons(); ++i)
{
for (int j = 0; j < triangleCount[i]; ++j)
{
for(unsigned int k=0; k < 3; ++k)
{
int v_idx = triangleList[tri_idx_offset+j*3 + k];
int match = -1;
int l = 0;
while (match < 0 && l < vertexCount[i])
{
if (vertexList[poly_idx_offset+l] == v_idx)
match = l;
++l;
}
triangleNList[tri_idx_offset+j*3 + k] = normalList[poly_idx_offset+match];
int id = 0;
if (uvIds.length() != 0)
mesh.getPolygonUVid(i, match, id);
triangleUVList[tri_idx_offset+j*3 + k] = id;
}
}
poly_idx_offset += vertexCount[i];
tri_idx_offset += 3 * triangleCount[i];
}
he.tlist.resize(triangleList.length(), -1);
//he.itlist.resize(triangleList.length());
he.itlist.resize(triangleList.length());
//std::map<std::pair<int, int>, int> h;
std::map<triplet, int> h;
int idx = 0;
for (int i = 0, n = triangleList.length(); i != n; ++i)
{
//std::pair<int, int> p = std::make_pair(triangleList[i], triangleNList[i]);
triplet p(triangleList[i], triangleNList[i], triangleUVList[i]);
//std::map<std::pair<int, int>, int>::const_iterator match = h.find(p);
std::map<triplet, int>::const_iterator match = h.find(p);
if (match != h.end())
{
he.tlist[i] = match->second;
he.itlist[i] = match->first;
}
else
{
h[p] = idx;
he.tlist[i] = idx;
he.itlist[i] = p;
++idx;
}
}
meshContainer->numHwVertices = he.idmax = idx;
if (mode == MESH_EXPORT_FULL_TOPOLOGY)
{
vertexCount.get(vcarray);
//.........这里部分代码省略.........
示例3: compute
MStatus LSSolverNode::compute(const MPlug& plug, MDataBlock& data)
{
MStatus stat;
if( plug == deformed)
{
MDataHandle tetWorldMatrixData = data.inputValue(tetWorldMatrix, &returnStatus);
McheckErr(returnStatus, "Error getting tetWorldMatrix data handle\n");
MDataHandle restShapeData = data.inputValue(restShape, &returnStatus);
McheckErr(returnStatus, "Error getting step data handle\n");
MDataHandle restVerticesData = data.inputValue(restVertices, &returnStatus);
McheckErr(returnStatus, "Error getting step data handle\n");
MDataHandle restElementsData = data.inputValue(restElements, &returnStatus);
McheckErr(returnStatus, "Error getting step data handle\n");
MDataHandle selectedConstraintVertsData = data.inputValue(selectedConstraintVerts, &returnStatus);
McheckErr(returnStatus, "Error getting step data handle\n");
MDataHandle selectedForceVertsData = data.inputValue(selectedForceVerts, &returnStatus);
McheckErr(returnStatus, "Error getting step data handle\n");
MDataHandle timeData = data.inputValue(time, &returnStatus);
McheckErr(returnStatus, "Error getting step data handle\n");
MDataHandle outputMeshData = data.outputValue(deformed, &returnStatus);
McheckErr(returnStatus, "Error getting outputMesh data handle\n");
MMatrix twmat = tetWorldMatrixData.asMatrix();
MObject rs = restShapeData.asMesh();
double t = timeData.asDouble();
MDataHandle poissonRatioData = data.inputValue(poissonRatio, &returnStatus);
McheckErr(returnStatus, "Error getting poissonRatio data handle\n");
MDataHandle youngsModulusData = data.inputValue(youngsModulus, &returnStatus);
McheckErr(returnStatus, "Error getting youngsmodulus data handle\n");
MDataHandle objectDensityData = data.inputValue(objectDensity, &returnStatus);
McheckErr(returnStatus, "Error getting objectDensity data handle\n");
MDataHandle frictionData = data.inputValue(friction, &returnStatus);
McheckErr(returnStatus, "Error getting friction data handle\n");
MDataHandle restitutionData = data.inputValue(restitution, &returnStatus);
McheckErr(returnStatus, "Error getting restitution data handle\n");
MDataHandle dampingData = data.inputValue(damping, &returnStatus);
McheckErr(returnStatus, "Error getting damping data handle\n");
MDataHandle userSuppliedDtData = data.inputValue(userSuppliedDt, &returnStatus);
McheckErr(returnStatus, "Error getting user supplied dt data handle\n");
MDataHandle integrationTypeData = data.inputValue(integrationType, &returnStatus);
McheckErr(returnStatus, "Error getting user integrationTypeData\n");
MDataHandle forceModelTypeData = data.inputValue(forceModelType, &returnStatus);
McheckErr(returnStatus, "Error getting user forceModelTypeData\n");
MDataHandle forceApplicationTimeData = data.inputValue(forceApplicationTime, &returnStatus);
McheckErr(returnStatus, "Error getting user forceApplicationTime\n");
MDataHandle forceReleasedTimeData = data.inputValue(forceReleasedTime, &returnStatus);
McheckErr(returnStatus, "Error getting user forceReleasedTime\n");
MDataHandle forceIncrementTimeData = data.inputValue(forceIncrementTime, &returnStatus);
McheckErr(returnStatus, "Error getting user forceIncrementTime\n");
MDataHandle forceStartTimeData = data.inputValue(forceStartTime, &returnStatus);
McheckErr(returnStatus, "Error getting user forceStartTime\n");
MDataHandle forceStopTimeData = data.inputValue(forceStopTime, &returnStatus);
McheckErr(returnStatus, "Error getting user forceStopTime\n");
MDataHandle forceMagnitudeData = data.inputValue(forceMagnitude, &returnStatus);
McheckErr(returnStatus, "Error getting user forceIdleTime\n");
MDataHandle useSuppliedForceData = data.inputValue(useSuppliedForce, &returnStatus);
McheckErr(returnStatus, "Error getting user forceIdleTime\n");
MDataHandle useSuppliedConstraintsData = data.inputValue(useSuppliedConstraints, &returnStatus);
McheckErr(returnStatus, "Error getting user forceIdleTime\n");
MDataHandle forceDirectionData = data.inputValue(forceDirection, &returnStatus);
McheckErr(returnStatus, "Error getting user forceDirection\n");
MDataHandle contactKsData = data.inputValue(contactKs, &returnStatus);
McheckErr(returnStatus, "Error getting user forceDirection\n");
MDataHandle contactKdData = data.inputValue(contactKd, &returnStatus);
McheckErr(returnStatus, "Error getting user forceDirection\n");
MTime currentTime, maxTime;
currentTime = MAnimControl::currentTime();
maxTime = MAnimControl::maxTime();
if (currentTime == MAnimControl::minTime())
//.........这里部分代码省略.........