本文整理汇总了C++中MNMesh::ClearVFlags方法的典型用法代码示例。如果您正苦于以下问题:C++ MNMesh::ClearVFlags方法的具体用法?C++ MNMesh::ClearVFlags怎么用?C++ MNMesh::ClearVFlags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MNMesh
的用法示例。
在下文中一共展示了MNMesh::ClearVFlags方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SlicePolyObject
void SymmetryMod::SlicePolyObject (MNMesh & mesh, Point3 & N, float offset) {
// Steve Anderson 9/14/2002
// Using the new "MN_MESH_TEMP_1" flag to override Slice selection behavior,
// which is undesirable here.
mesh.SetFlag (MN_MESH_TEMP_1);
// Slice off everything below the plane:
mesh.Slice (N, offset, MNEPS, false, true);
mesh.ClearFlag (MN_MESH_TEMP_1);
// Make sure we have a valid edge list:
if (!mesh.GetFlag (MN_MESH_FILLED_IN)) mesh.FillInMesh();
// Mark the vertices on the plane boundary:
mesh.ClearVFlags (MN_USER);
for (int i=0; i<mesh.numv; i++) {
if (mesh.v[i].GetFlag (MN_DEAD)) continue;
float dist = DotProd (N, mesh.P(i)) - offset;
if (fabsf(dist) > MNEPS) continue;
mesh.v[i].SetFlag (MN_USER);
}
// Strip out faces on the mirror plane: (These aren't always removed by slice.)
// Find the faces that use only mirror-plane vertices:
mesh.ClearFFlags (MN_USER);
mesh.PropegateComponentFlags (MNM_SL_FACE, MN_USER,
MNM_SL_VERTEX, MN_USER, true);
mesh.DeleteFlaggedFaces (MN_USER);
// Clear out dead components:
mesh.CollapseDeadStructs ();
}
示例2: SetPolyFlags
void VWeldMod::SetPolyFlags (MNMesh & mesh, DWORD flag) {
// Convert existing selection (at whatever level) to vertex selection:
mesh.ClearVFlags (flag);
if (mesh.selLevel == MNM_SL_OBJECT) {
for (int i=0; i<mesh.numv; i++) mesh.v[i].SetFlag (flag);
} else {
mesh.PropegateComponentFlags (MNM_SL_VERTEX, flag, mesh.selLevel, MN_SEL);
}
}
示例3: WeldPolyObject
void SymmetryMod::WeldPolyObject (MNMesh & mesh, Point3 & N, float offset, float threshold) {
// Mark the vertices within the welding threshold of the plane:
mesh.ClearVFlags (MN_USER);
for (int i=0; i<mesh.numv; i++) {
if (mesh.v[i].GetFlag (MN_DEAD)) continue;
float dist = DotProd (N, mesh.P(i)) - offset;
if (fabsf(dist) > threshold) continue;
mesh.v[i].SetFlag (MN_USER);
}
// Do the welding:
if (mesh.WeldBorderVerts (threshold, MN_USER)) {
// If result was true, we have some MN_DEAD components:
mesh.CollapseDeadStructs ();
}
}
示例4: ModifyObject
void SelectByChannel::ModifyObject(TimeValue t, ModContext &mc, ObjectState * os, INode *node)
{
//TODO: Add the code for actually modifying the object
//get th map id
// TriObject *tobj = (TriObject*)os->obj;
// Mesh &mesh = tobj->GetMesh();
Mesh *mesh = NULL;
MNMesh *mnmesh = NULL;
TriObject *collapsedtobj = NULL;
if (os->obj->IsSubClassOf(triObjectClassID))
{
TriObject *tobj = (TriObject*)os->obj;
mesh = &tobj->GetMesh();
}
else if (os->obj->IsSubClassOf(polyObjectClassID))
{
PolyObject *pobj = (PolyObject*)os->obj;
mnmesh = &pobj->GetMesh();
}
int mapID;
int subID;
int selType;
pblock->GetValue(pb_mapid,0,mapID,FOREVER);
pblock->GetValue(pb_mapsubid,0,subID,FOREVER);
pblock->GetValue(pb_seltype,0,selType,FOREVER);
if (subID < 0) subID = 0;
if (subID > 2) subID = 2;
if (mnmesh)
{
int numMaps = mnmesh->numm;
mnmesh->dispFlags = MNDISP_VERTTICKS|MNDISP_SELVERTS ;
mnmesh->selLevel = MNM_SL_VERTEX;
if (mapID < numMaps)
{
UVVert *uvw = mnmesh->M(mapID)->v;
MNMapFace *uvwFace = mnmesh->M(mapID)->f;
if (uvw && uvwFace)
{
float *vsw = NULL;
MNFace *face = mnmesh->f;
vsw = mnmesh->getVSelectionWeights ();
if (vsw == NULL)
{
mnmesh->SupportVSelectionWeights();
vsw = mnmesh->getVSelectionWeights ();
}
BitArray processed;
processed.SetSize(mnmesh->numv);
processed.ClearAll();
if (vsw && uvwFace && uvw)
{
if (selType == 0)
{
mnmesh->ClearVFlags (MN_SEL);
for (int i = 0; i < mnmesh->numv; i++)
vsw[i] = 0.0f;
}
for (int i = 0; i < mnmesh->numf; i++)
{
int deg = face[i].deg;
for (int j = 0; j < deg; j++)
{
int index = uvwFace[i].tv[j];
int gindex = face[i].vtx[j];
if (!processed[gindex])
{
processed.Set(gindex);
if (selType == 0)
{
float w = uvw[index][subID];
if (w >= 1.0f)
mnmesh->v[gindex].SetFlag (MN_SEL);
//.........这里部分代码省略.........
示例5: ModifyObject
//.........这里部分代码省略.........
for (int i = 0; i < buffer.numFaces; i++)
{
geomFace[i] = *buffer.geomMNFaces[i];
}
}
else
{
for (int i = 0; i < buffer.numFaces; i++)
{
geomFace[i].MakePoly(buffer.uvwMNFaces[i]->deg,buffer.uvwMNFaces[i]->tv);
// geomFace[i].v[0] = buffer.uvwMNFaces[i].t[0];
// geomFace[i].v[1] = buffer.uvwMNFaces[i].t[1];
// geomFace[i].v[2] = buffer.uvwMNFaces[i].t[2];
}
}
}
else if ((buffer.pasteToChannelType == POLYSELCHANNEL) || (buffer.pasteToChannelType == CHANNEL_SEL))
{
MNVert *verts = mnmesh->v;
MNFace *geomFace = mnmesh->f;
mnmesh->SupportVSelectionWeights();
float *vsw = NULL;
vsw = mnmesh->getVSelectionWeights ();
mnmesh->ClearVFlags (MN_SEL);
// mesh->vertSel.ClearAll();
/* for (int i = 0; i < buffer.w.Count(); i++)
{
if (vsw)
{
vsw[i] = buffer.w[i];
if (vsw[i] >= 1.0f)
mnmesh->v[i].SetFlag (MN_SEL);
}
}
*/
if ((buffer.copyType == POLYMESH_GEOM) || (buffer.copyType == POLYMESH_SEL))
{
for (int i = 0; i < buffer.numFaces; i++)
{
// geomFace[i] = *buffer.geomMNFaces[i];
for (int k = 0; k < geomFace[i].deg; k++)
{
// geomFace[i].vtx[k] = buffer.uvwMNFaces[i]->tv[k];
int id = buffer.geomMNFaces[i]->vtx[k];
int gid = geomFace[i].vtx[k];
if (vsw)
{
vsw[gid] = buffer.w[id];
}
}
}