File indexing completed on 2026-09-28 09:19:37
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _BRepGraphInc_Instance_HeaderFile
0015 #define _BRepGraphInc_Instance_HeaderFile
0016
0017 #include <BRepGraph_NodeId.hxx>
0018 #include <Standard_HashUtils.hxx>
0019 #include <TopAbs_Orientation.hxx>
0020 #include <TopLoc_Location.hxx>
0021
0022 #include <functional>
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 namespace BRepGraphInc
0038 {
0039
0040
0041
0042
0043
0044
0045 template <typename TypedIdT>
0046 struct Instance
0047 {
0048 TypedIdT DefId;
0049 TopLoc_Location Location;
0050 TopAbs_Orientation Orientation = TopAbs_FORWARD;
0051
0052
0053 [[nodiscard]] bool IsValid() const { return DefId.IsValid(); }
0054 };
0055
0056 using VertexInstance = Instance<BRepGraph_VertexId>;
0057 using CoEdgeInstance = Instance<BRepGraph_CoEdgeId>;
0058 using WireInstance = Instance<BRepGraph_WireId>;
0059 using FaceInstance = Instance<BRepGraph_FaceId>;
0060 using ShellInstance = Instance<BRepGraph_ShellId>;
0061 using SolidInstance = Instance<BRepGraph_SolidId>;
0062 using OccurrenceInstance = Instance<BRepGraph_OccurrenceId>;
0063 using CompoundInstance = Instance<BRepGraph_CompoundId>;
0064 using CompSolidInstance = Instance<BRepGraph_CompSolidId>;
0065 using ProductInstance = Instance<BRepGraph_ProductId>;
0066
0067
0068
0069
0070
0071
0072 using NodeInstance = Instance<BRepGraph_NodeId>;
0073
0074 }
0075
0076
0077 template <typename TypedIdT>
0078 struct std::hash<BRepGraphInc::Instance<TypedIdT>>
0079 {
0080 size_t operator()(const BRepGraphInc::Instance<TypedIdT>& theInstance) const noexcept
0081 {
0082 size_t aCombination[3];
0083 aCombination[0] = std::hash<TypedIdT>{}(theInstance.DefId);
0084 aCombination[1] = theInstance.Location.HashCode();
0085 aCombination[2] = opencascade::hash(static_cast<int>(theInstance.Orientation));
0086 return opencascade::hashBytes(aCombination, sizeof(aCombination));
0087 }
0088 };
0089
0090 #endif