本文整理汇总了C++中BitArray::IsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ BitArray::IsEmpty方法的具体用法?C++ BitArray::IsEmpty怎么用?C++ BitArray::IsEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitArray
的用法示例。
在下文中一共展示了BitArray::IsEmpty方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DeleteFaces
void XTCSample::DeleteFaces(TimeValue t,Object *obj)
{
if(bNF_OnOff)
{
Mesh *mesh = GetMesh(obj);
if(!mesh)
return;
Interval ivalid = FOREVER;
int nf;
bo->GetParamBlockByID(x_params)->GetValue(pb_nf_spin,t,nf, ivalid);
BitArray ba;
ba.SetSize(mesh->getNumFaces());
ba.ClearAll();
for(int i = nf ; i < mesh->getNumFaces() ; i++ )
{
ba.Set(i);
}
if(!ba.IsEmpty())
mesh->DeleteFaceSet(ba);
}
}
示例2: GeometryCheck
IGeometryChecker::ReturnVal OverlappedUVWFacesChecker::GeometryCheck(TimeValue t,INode *nodeToCheck, IGeometryChecker::OutputVal &val)
{
val.mIndex.ZeroCount();
if(IsSupported(nodeToCheck))
{
UVWChannel uvmesh;
ObjectState os = nodeToCheck->EvalWorldState(t);
Object *obj = os.obj;
if(os.obj->IsSubClassOf(triObjectClassID))
{
TriObject *tri = dynamic_cast<TriObject *>(os.obj);
if(tri)
{
BitArray arrayOfFaces;
arrayOfFaces.SetSize(tri->mesh.numFaces);
arrayOfFaces.ClearAll();
IGeometryChecker::ReturnVal returnval=IGeometryChecker::eFail;
int numChannels = tri->mesh.getNumMaps();
for(int i=0;i<numChannels;++i)
{
if(tri->mesh.mapSupport(i))
{
uvmesh.DeleteData();
uvmesh.SetWithMesh(&tri->mesh,i);
if(uvmesh.GetNumOfFaces()>1)
{
//okay now run it with that uvmesh
returnval = GeometryCheckWithUVMesh(uvmesh,t, nodeToCheck,arrayOfFaces);
if(returnval ==IGeometryChecker::eFail)
return returnval;
}
}
}
if(arrayOfFaces.IsEmpty()==false) //we have overlapping faces
{
int localsize= arrayOfFaces.GetSize();
for(int i=0;i<localsize;++i)
{
if(arrayOfFaces[i])
val.mIndex.Append(1,&i);
}
}
return returnval;
}
else return IGeometryChecker::eFail;
}
else if(os.obj->IsSubClassOf(polyObjectClassID))
{
PolyObject *poly = dynamic_cast<PolyObject *>(os.obj);
if(poly)
{
BitArray arrayOfFaces;
arrayOfFaces.SetSize(poly->GetMesh().numf);
arrayOfFaces.ClearAll();
IGeometryChecker::ReturnVal returnval=IGeometryChecker::eFail;
int numChannels= poly->GetMesh().MNum();//do this!
for(int i=0;i<numChannels;++i)
{
if(poly->GetMesh().M(i))
{
uvmesh.DeleteData();
uvmesh.SetWithMesh(&poly->GetMesh(),i);
if(uvmesh.GetNumOfFaces()>1)
{
//okay now run it with that uvmesh
returnval = GeometryCheckWithUVMesh(uvmesh,t, nodeToCheck,arrayOfFaces);
if(returnval ==IGeometryChecker::eFail)
return returnval;
}
}
}
if(arrayOfFaces.IsEmpty()==false) //we have overlapping faces
{
int localsize= arrayOfFaces.GetSize();
for(int i=0;i<localsize;++i)
{
if(arrayOfFaces[i])
val.mIndex.Append(1,&i);
}
}
return returnval;
}
else return IGeometryChecker::eFail;
}
}
return IGeometryChecker::eFail;
}
示例3: GeometryCheck
IGeometryChecker::ReturnVal MultipleEdgeChecker::GeometryCheck(TimeValue t,INode *nodeToCheck, IGeometryChecker::OutputVal &val)
{
val.mIndex.ZeroCount();
if(IsSupported(nodeToCheck))
{
LARGE_INTEGER ups,startTime;
QueryPerformanceFrequency(&ups);
QueryPerformanceCounter(&startTime); //used to see if we need to pop up a dialog
bool compute = true;
bool checkTime = GetIGeometryCheckerManager()->GetAutoUpdate();//only check time for the dialog if auto update is active!
ObjectState os = nodeToCheck->EvalWorldState(t);
Object *obj = os.obj;
BitArray arrayOfEdges; //we fill this up with the verts, if not empty then we have isolated vets
EdgeFaceList edgeList;
if(os.obj->IsSubClassOf(triObjectClassID))
{
TriObject *tri = dynamic_cast<TriObject *>(os.obj);
if(tri)
{
Mesh &mesh = tri->GetMesh();
edgeList.CreateEdgeFaceList(mesh);
if(checkTime)
{
DialogChecker::Check(checkTime,compute,mesh.numFaces,startTime,ups);
if(compute==false)
return IGeometryChecker::eFail;
}
arrayOfEdges.SetSize(CheckerMeshEdge::GetTotalNumEdges(mesh.numFaces));
arrayOfEdges.ClearAll();
}
else return IGeometryChecker::eFail;
}
else if(os.obj->IsSubClassOf(polyObjectClassID))
{
PolyObject *poly = dynamic_cast<PolyObject *>(os.obj);
if(poly)
{
MNMesh &mnMesh = poly->GetMesh();
edgeList.CreateEdgeFaceList(mnMesh);
if(checkTime)
{
DialogChecker::Check(checkTime,compute,mnMesh.numf,startTime,ups);
if(compute==false)
return IGeometryChecker::eFail;
}
arrayOfEdges.SetSize(mnMesh.nume);
arrayOfEdges.ClearAll();
}
else return IGeometryChecker::eFail;
}
#pragma omp parallel for
for(int i=0;i<edgeList.mNumVertexEdges;++i)
{
for(int j=0;j<edgeList.mVertexEdges[i]->mEdges.Count();++j)
{
EdgeFaceList::Edge *localEdge = edgeList.mVertexEdges[i]->mEdges[j];
if(localEdge)
{
if(localEdge->mFaces.Count()>2)
{
#pragma omp critical
{
arrayOfEdges.Set(localEdge->mEdgeNum);
}
}
}
}
}
if(arrayOfEdges.IsEmpty()==false) //we have an isolated vierts
{
int localsize= arrayOfEdges.GetSize();
for(int i=0;i<localsize;++i)
{
if(arrayOfEdges[i])
val.mIndex.Append(1,&i);
}
}
return TypeReturned();
}
return IGeometryChecker::eFail;
}
示例4: GeometryCheck
IGeometryChecker::ReturnVal MissingUVCoordinatesChecker::GeometryCheck(TimeValue t,INode *nodeToCheck, IGeometryChecker::OutputVal &val)
{
val.mIndex.ZeroCount();
if(IsSupported(nodeToCheck))
{
LARGE_INTEGER ups,startTime;
QueryPerformanceFrequency(&ups);
QueryPerformanceCounter(&startTime); //used to see if we need to pop up a dialog
bool compute = true;
bool checkTime = GetIGeometryCheckerManager()->GetAutoUpdate();//only check time for the dialog if auto update is active!
UVWChannel uvmesh;
ObjectState os = nodeToCheck->EvalWorldState(t);
Object *obj = os.obj;
if(os.obj->IsSubClassOf(triObjectClassID))
{
TriObject *tri = dynamic_cast<TriObject *>(os.obj);
if(tri)
{
BitArray arrayOfVertices;
arrayOfVertices.SetSize(tri->mesh.numVerts);
arrayOfVertices.ClearAll();
IGeometryChecker::ReturnVal returnval=IGeometryChecker::eFail;
int numChannels = tri->mesh.getNumMaps();
int index;
for(int i=0;i<numChannels;++i)
{
if(tri->mesh.mapSupport(i))
{
MeshMap *map = &tri->mesh.Map(i);
if(map->getNumVerts()>0 &&map->getNumFaces()>0)
{
returnval= TypeReturned();
int numFaces = map->getNumFaces();
TVFace * tvFaces = map->tf;
UVVert * uvVerts= map->tv;
#pragma omp parallel for
for(int faceIndex =0;faceIndex<numFaces;++faceIndex)
{
if(compute)
{
TVFace& tvFace = tvFaces[faceIndex];
Point3 tv = uvVerts[tvFace.t[0]];
if(_isnan(tv.x) || !_finite(tv.x)||_isnan(tv.y) || !_finite(tv.y)||_isnan(tv.z) || !_finite(tv.z))
{
index = tri->mesh.faces[faceIndex].v[0];
if(index>=0&&index<tri->mesh.numVerts)
{
#pragma omp critical
{
arrayOfVertices.Set(index);
}
}
}
tv = uvVerts[tvFace.t[1]];
if(_isnan(tv.x) || !_finite(tv.x)||_isnan(tv.y) || !_finite(tv.y)||_isnan(tv.z) || !_finite(tv.z))
{
index = tri->mesh.faces[faceIndex].v[1];
if(index>=0&&index<tri->mesh.numVerts)
{
#pragma omp critical
{
arrayOfVertices.Set(index);
}
}
}
tv = uvVerts[tvFace.t[2]];
if(_isnan(tv.x) || !_finite(tv.x)||_isnan(tv.y) || !_finite(tv.y)||_isnan(tv.z) || !_finite(tv.z))
{
index = tri->mesh.faces[faceIndex].v[2];
if(index>=0&&index<tri->mesh.numVerts)
{
#pragma omp critical
{
arrayOfVertices.Set(index);
}
}
}
if(checkTime==true)
{
#pragma omp critical
{
DialogChecker::Check(checkTime,compute,numFaces,startTime,ups);
}
}
}
}
}
}
}
if(arrayOfVertices.IsEmpty()==false) //we have overlapping faces
{
int localsize= arrayOfVertices.GetSize();
for(int i=0;i<localsize;++i)
{
if(arrayOfVertices[i])
val.mIndex.Append(1,&i);
}
}
//.........这里部分代码省略.........
示例5: GeometryCheck
IGeometryChecker::ReturnVal IsolatedVertexChecker::GeometryCheck(TimeValue t,INode *nodeToCheck, IGeometryChecker::OutputVal &val)
{
val.mIndex.ZeroCount();
if(IsSupported(nodeToCheck))
{
LARGE_INTEGER ups,startTime;
QueryPerformanceFrequency(&ups);
QueryPerformanceCounter(&startTime); //used to see if we need to pop up a dialog
bool compute = true;
bool checkTime = GetIGeometryCheckerManager()->GetAutoUpdate();//only check time for the dialog if auto update is active!
ObjectState os = nodeToCheck->EvalWorldState(t);
Object *obj = os.obj;
BitArray arrayOfVerts; //we fill this up with the verts, if not empty then we have isolated vets
if(os.obj->IsSubClassOf(triObjectClassID))
{
TriObject *tri = dynamic_cast<TriObject *>(os.obj);
if(tri)
{
Mesh &mesh = tri->GetMesh();
arrayOfVerts.SetSize(mesh.numVerts);
arrayOfVerts.SetAll ();
for (int i=0; i<mesh.numFaces; i++) {
for (int j=0; j<3; j++) arrayOfVerts.Clear(mesh.faces[i].v[j]);
if(checkTime==true)
{
DialogChecker::Check(checkTime,compute,mesh.numFaces,startTime,ups);
if(compute==false)
break;
}
}
}
else return IGeometryChecker::eFail;
}
else if(os.obj->IsSubClassOf(polyObjectClassID))
{
PolyObject *poly = dynamic_cast<PolyObject *>(os.obj);
if(poly)
{
MNMesh &mnMesh = poly->GetMesh();
arrayOfVerts.SetSize(mnMesh.numv);
arrayOfVerts.SetAll();
for(int i=0;i<mnMesh.numf;++i)
{
for(int j=0;j<mnMesh.f[i].deg;++j)
{
if(mnMesh.f[i].GetFlag(MN_DEAD)==0)
arrayOfVerts.Clear(mnMesh.f[i].vtx[j]);
}
if(checkTime==true)
{
DialogChecker::Check(checkTime,compute,mnMesh.numf,startTime,ups);
if(compute==false)
break;
}
}
}
else return IGeometryChecker::eFail;
}
if(arrayOfVerts.IsEmpty()==false) //we have an isolated vierts
{
int localsize= arrayOfVerts.GetSize();
for(int i=0;i<localsize;++i)
{
if(arrayOfVerts[i])
val.mIndex.Append(1,&i);
}
}
return TypeReturned();
}
return IGeometryChecker::eFail;
}