本文整理汇总了C++中TopoDS_Edge::Nullify方法的典型用法代码示例。如果您正苦于以下问题:C++ TopoDS_Edge::Nullify方法的具体用法?C++ TopoDS_Edge::Nullify怎么用?C++ TopoDS_Edge::Nullify使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TopoDS_Edge
的用法示例。
在下文中一共展示了TopoDS_Edge::Nullify方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ASSERT
TopoDS_Edge
StdMeshers_Hexa_3D::EdgeNotInFace(SMESH_Mesh & aMesh,
const TopoDS_Shape & aShape,
const TopoDS_Face & aFace,
const TopoDS_Vertex & aVertex,
const TopTools_IndexedDataMapOfShapeListOfShape & MS)
{
//MESSAGE("StdMeshers_Hexa_3D::EdgeNotInFace");
TopTools_IndexedDataMapOfShapeListOfShape MF;
TopExp::MapShapesAndAncestors(aFace, TopAbs_VERTEX, TopAbs_EDGE, MF);
const TopTools_ListOfShape & ancestorsInSolid = MS.FindFromKey(aVertex);
const TopTools_ListOfShape & ancestorsInFace = MF.FindFromKey(aVertex);
// SCRUTE(ancestorsInSolid.Extent());
// SCRUTE(ancestorsInFace.Extent());
ASSERT(ancestorsInSolid.Extent() == 6); // 6 (edges doublees)
ASSERT(ancestorsInFace.Extent() == 2);
TopoDS_Edge E;
E.Nullify();
TopTools_ListIteratorOfListOfShape its(ancestorsInSolid);
for (; its.More(); its.Next())
{
TopoDS_Shape ancestor = its.Value();
TopTools_ListIteratorOfListOfShape itf(ancestorsInFace);
bool isInFace = false;
for (; itf.More(); itf.Next())
{
TopoDS_Shape ancestorInFace = itf.Value();
if (ancestorInFace.IsSame(ancestor))
{
isInFace = true;
break;
}
}
if (!isInFace)
{
E = TopoDS::Edge(ancestor);
break;
}
}
return E;
}
示例2: SelectEdge
//=======================================================================
//function : SelectEdge
//purpose : Find the edge <NE> connected <CE> by the vertex <CV> in the list <LE>.
// <NE> Is erased of the list. If <CE> is too in the list <LE>
// with the same orientation, it's erased of the list
//=======================================================================
static Standard_Boolean SelectEdge(const TopoDS_Face& F,
const TopoDS_Edge& CE,
const TopoDS_Vertex& CV,
TopoDS_Edge& NE,
TopTools_ListOfShape& LE)
{
TopTools_ListIteratorOfListOfShape itl;
NE.Nullify();
for ( itl.Initialize(LE); itl.More(); itl.Next()) {
if (itl.Value().IsEqual(CE)) {
LE.Remove(itl);
break;
}
}
if (LE.Extent() > 1) {
//--------------------------------------------------------------
// Several possible edges.
// - Test the edges differents of CE
//--------------------------------------------------------------
Standard_Real cf, cl, f, l;
TopoDS_Face FForward = F;
Handle(Geom2d_Curve) Cc, C;
FForward.Orientation(TopAbs_FORWARD);
Cc = BRep_Tool::CurveOnSurface(CE,FForward,cf,cl);
Standard_Real dist,distmin = 100*BRep_Tool::Tolerance(CV);
Standard_Real uc,u;
if (CE.Orientation () == TopAbs_FORWARD) uc = cl;
else uc = cf;
gp_Pnt2d P2,PV = Cc->Value(uc);
Standard_Real delta = FindDelta(LE,FForward);
for ( itl.Initialize(LE); itl.More(); itl.Next()) {
const TopoDS_Edge& E = TopoDS::Edge(itl.Value());
if (!E.IsSame(CE)) {
C = BRep_Tool::CurveOnSurface(E,FForward,f,l);
if (E.Orientation () == TopAbs_FORWARD) u = f;
else u = l;
P2 = C->Value(u);
dist = PV.Distance(P2);
if (dist <= distmin){
distmin = dist;
}
}
}
Standard_Real anglemax = - PI;
TopoDS_Edge SelectedEdge;
for ( itl.Initialize(LE); itl.More(); itl.Next()) {
const TopoDS_Edge& E = TopoDS::Edge(itl.Value());
if (!E.IsSame(CE)) {
C = BRep_Tool::CurveOnSurface(E,FForward,f,l);
if (E.Orientation () == TopAbs_FORWARD) u = f;
else u = l;
P2 = C->Value(u);
dist = PV.Distance(P2);
if (dist <= distmin + (1./3)*delta){
gp_Pnt2d PC, P;
gp_Vec2d CTg1, CTg2, Tg1, Tg2;
Cc->D2(uc, PC, CTg1, CTg2);
C->D2(u, P, Tg1, Tg2);
Standard_Real angle;
if (CE.Orientation () == TopAbs_REVERSED && E.Orientation () == TopAbs_FORWARD) {
angle = CTg1.Angle(Tg1.Reversed());
}
else if (CE.Orientation () == TopAbs_FORWARD && E.Orientation () == TopAbs_REVERSED) {
angle = (CTg1.Reversed()).Angle(Tg1);
}
else if (CE.Orientation () == TopAbs_REVERSED && E.Orientation () == TopAbs_REVERSED) {
angle = CTg1.Angle(Tg1);
}
else if (CE.Orientation () == TopAbs_FORWARD && E.Orientation () == TopAbs_FORWARD) {
angle = (CTg1.Reversed()).Angle(Tg1.Reversed());
}
if (angle >= anglemax) {
anglemax = angle ;
SelectedEdge = E;
}
}
}
}
for ( itl.Initialize(LE); itl.More(); itl.Next()) {
const TopoDS_Edge& E = TopoDS::Edge(itl.Value());
if (E.IsEqual(SelectedEdge)) {
NE = TopoDS::Edge(E);
LE.Remove(itl);
break;
}
//.........这里部分代码省略.........