@@ -116,14 +116,14 @@ class asiAlgo_AAG : public Standard_Transient
116
116
// ! for adjacency relation.
117
117
struct t_arc
118
118
{
119
- int F1; // !< First face.
120
- int F2; // !< Second face.
119
+ t_topoId F1; // !< First face.
120
+ t_topoId F2; // !< Second face.
121
121
122
122
// ! ctor default.
123
123
t_arc () : F1(0 ), F2(0 ) {}
124
124
125
125
// ! ctor with parameters.
126
- t_arc (const int _F1, const int _F2) : F1(_F1), F2(_F2) {}
126
+ t_arc (const t_topoId _F1, const t_topoId _F2) : F1(_F1), F2(_F2) {}
127
127
128
128
// ! \return hash code for the arc.
129
129
static int HashCode (const t_arc& arc, const int upper)
@@ -280,7 +280,7 @@ class asiAlgo_AAG : public Standard_Transient
280
280
typedef NCollection_DataMap<t_arc, Handle(asiAlgo_FeatureAttr), t_arc> t_arc_attributes;
281
281
282
282
// ! Node attributes.
283
- typedef NCollection_DataMap<int , t_attr_set> t_node_attributes;
283
+ typedef NCollection_DataMap<t_topoId , t_attr_set> t_node_attributes;
284
284
285
285
// ---------------------------------------------------------------------------
286
286
@@ -398,7 +398,7 @@ class asiAlgo_AAG : public Standard_Transient
398
398
// !
399
399
// ! \sa PopSubgraph() method to pop the created sub-graph from the stack.
400
400
asiAlgo_EXPORT void
401
- PushSubgraphX (const int face2Exclude);
401
+ PushSubgraphX (const t_topoId face2Exclude);
402
402
403
403
// ! \brief Pops the top sub-graph from the internal stack.
404
404
// !
@@ -435,7 +435,7 @@ class asiAlgo_AAG : public Standard_Transient
435
435
// ! \param[in] face_idx face index.
436
436
// ! \return true/false.
437
437
asiAlgo_EXPORT bool
438
- HasFace (const int face_idx) const ;
438
+ HasFace (const t_topoId face_idx) const ;
439
439
440
440
// ! Returns true if the passed face is in graph.
441
441
// ! \param[in] face face to check.
@@ -447,12 +447,12 @@ class asiAlgo_AAG : public Standard_Transient
447
447
// ! \param[in] face_idx face index.
448
448
// ! \return topological face.
449
449
asiAlgo_EXPORT const TopoDS_Face&
450
- GetFace (const int face_idx) const ;
450
+ GetFace (const t_topoId face_idx) const ;
451
451
452
452
// ! Returns face ID.
453
453
// ! \param[in] face face of interest.
454
454
// ! \return face ID.
455
- asiAlgo_EXPORT int
455
+ asiAlgo_EXPORT t_topoId
456
456
GetFaceId (const TopoDS_Shape& face) const ;
457
457
458
458
// ! Checks whether the given face has any neighbors recorded in the AAG.
@@ -461,29 +461,29 @@ class asiAlgo_AAG : public Standard_Transient
461
461
// ! \param[in] face_idx face index.
462
462
// ! \return true in case if at least one neighbor presents, false -- otherwise.
463
463
asiAlgo_EXPORT bool
464
- HasNeighbors (const int face_idx) const ;
464
+ HasNeighbors (const t_topoId face_idx) const ;
465
465
466
466
// ! Returns neighbors for the face having the given internal index.
467
467
// ! \param[in] face_idx face index.
468
468
// ! \return indices of the neighbor faces.
469
469
asiAlgo_EXPORT const TColStd_PackedMapOfInteger&
470
- GetNeighbors (const int face_idx) const ;
470
+ GetNeighbors (const t_topoId face_idx) const ;
471
471
472
472
// ! Returns only those neighbor faces which share the given edge with the
473
473
// ! passed face of interest.
474
474
// ! \param[in] face_idx ID of the face of interest.
475
475
// ! \param[in] edge common edge.
476
476
// ! \return indices of the neighbor faces sharing the given edge.
477
477
asiAlgo_EXPORT TColStd_PackedMapOfInteger
478
- GetNeighborsThru (const int face_idx, const TopoDS_Edge& edge);
478
+ GetNeighborsThru (const t_topoId face_idx, const TopoDS_Edge& edge);
479
479
480
480
// ! Returns neighbor faces for the given face of interest with additional
481
481
// ! filter on edges realizing the neighborhood.
482
482
// ! \param[in] face_idx index of the face of interest.
483
483
// ! \param[in] edge_ids indices of edges of interest.
484
484
// ! \return indices of the neighbor faces.
485
485
asiAlgo_EXPORT TColStd_PackedMapOfInteger
486
- GetNeighborsThru (const int face_idx,
486
+ GetNeighborsThru (const t_topoId face_idx,
487
487
const TColStd_PackedMapOfInteger& edge_ids);
488
488
489
489
// ! Returns only those neighbor faces which do not share the given edges with
@@ -492,7 +492,7 @@ class asiAlgo_AAG : public Standard_Transient
492
492
// ! \param[in] xEdges edge where neighborhood is restricted.
493
493
// ! \return indices of the neighbor faces not sharing the given edges.
494
494
asiAlgo_EXPORT TColStd_PackedMapOfInteger
495
- GetNeighborsThruX (const int face_idx, const TColStd_PackedMapOfInteger& xEdges);
495
+ GetNeighborsThruX (const t_topoId face_idx, const TColStd_PackedMapOfInteger& xEdges);
496
496
497
497
// ! Returns full collection of neighbor faces.
498
498
// ! \return neighborhood data.
@@ -625,7 +625,7 @@ class asiAlgo_AAG : public Standard_Transient
625
625
// ! \param[in] node ID of the graph node to check.
626
626
// ! \return true/false.
627
627
asiAlgo_EXPORT bool
628
- HasNodeAttributes (const int node) const ;
628
+ HasNodeAttributes (const t_topoId node) const ;
629
629
630
630
// ! Accessor for the entire collection of nodal attributes.
631
631
// ! \return attributes associated with all graph node.
@@ -636,14 +636,14 @@ class asiAlgo_AAG : public Standard_Transient
636
636
// ! \param[in] node ID of the graph node of interest.
637
637
// ! \return attributes associated with the given graph node.
638
638
asiAlgo_EXPORT const t_attr_set&
639
- GetNodeAttributes (const int node) const ;
639
+ GetNodeAttributes (const t_topoId node) const ;
640
640
641
641
// ! Returns attribute associated with the given graph node.
642
642
// ! \param[in] node ID of the graph node of interest.
643
643
// ! \param[in] attr_id ID of the attribute to access.
644
644
// ! \return attribute associated with the given node.
645
645
asiAlgo_EXPORT Handle (asiAlgo_FeatureAttr)
646
- GetNodeAttribute(const int node,
646
+ GetNodeAttribute(const t_topoId node,
647
647
const Standard_GUID& attr_id) const ;
648
648
649
649
// ! Removes attribute with the passed GUID from the given graph node.
@@ -652,7 +652,7 @@ class asiAlgo_AAG : public Standard_Transient
652
652
// ! \return true if the attribute was removed, false -- otherwise (e.g., if
653
653
// ! such attribute does not exist).
654
654
asiAlgo_EXPORT bool
655
- RemoveNodeAttribute (const int node,
655
+ RemoveNodeAttribute (const t_topoId node,
656
656
const Standard_GUID& attr_id);
657
657
658
658
// ! Removes all attributes assigned to nodes.
@@ -669,9 +669,15 @@ class asiAlgo_AAG : public Standard_Transient
669
669
// ! \param[in] node ID of the graph node of interest.
670
670
// ! \param[in] attr attribute to set.
671
671
asiAlgo_EXPORT bool
672
- SetNodeAttribute (const int node,
672
+ SetNodeAttribute (const t_topoId node,
673
673
const Handle (asiAlgo_FeatureAttr)& attr);
674
674
675
+ // ! Finds base faces, i.e., the faces having inner loops.
676
+ // ! \param[out] resultFaceIds IDs of the found faces (if any).
677
+ // ! \return true if anything has been found, false -- otherwise.
678
+ asiAlgo_EXPORT bool
679
+ FindBaseOnly (TColStd_PackedMapOfInteger& resultFaceIds) const ;
680
+
675
681
// ! Searches for the faces having ALL neighbors attributed with convex links.
676
682
// ! \param[out] resultFaceIds IDs of the found faces (if any).
677
683
// ! \return true if anything has been found, false -- otherwise.
@@ -737,7 +743,7 @@ class asiAlgo_AAG : public Standard_Transient
737
743
// ! \param[in] fid face ID in question.
738
744
// ! \return attribute.
739
745
template <typename t_attr_type>
740
- Handle (t_attr_type) ATTR_NODE(const int fid) const
746
+ Handle (t_attr_type) ATTR_NODE(const t_topoId fid) const
741
747
{
742
748
return Handle (t_attr_type)::DownCast ( this ->GetNodeAttribute ( fid, t_attr_type::GUID () ) );
743
749
}
@@ -809,7 +815,7 @@ class asiAlgo_AAG : public Standard_Transient
809
815
// ! \param[in,out] out target output stream.
810
816
// ! \param[in] whitespace num of spaces to prefix each row.
811
817
asiAlgo_EXPORT void
812
- dumpNodeJSON (const int node,
818
+ dumpNodeJSON (const t_topoId node,
813
819
const bool isFirst,
814
820
Standard_OStream& out,
815
821
const int whitespace = 0 ) const ;
0 commit comments