private bool CreateEdge(DataRep.CADComponent aparent, DataRep.StructuralInterfaceConstraint a, DataRep.CADComponent bparent, DataRep.StructuralInterfaceConstraint b, bool size2fit = false) { structuralInfProcessed.Add(a.PortID); structuralInfProcessed.Add(b.PortID); // Create Edge DataRep.CADEdge edge = new DataRep.CADEdge(aparent, bparent) { SrcPortID = a.PortID, DstPortID = b.PortID, SrcPortName = a.Name, DstPortName = b.Name, DegreeFreedom = a.DegreeFreedom, SrcIntf = a, DstIntf = b }; List <Tuple <DataRep.Datum, DataRep.Datum> > constraintPairs = new List <Tuple <DataRep.Datum, DataRep.Datum> >(); bool result = DataRep.StructuralInterfaceConstraint.MatchStructuralInterfaceDatums(a, b, constraintPairs, Traceability); edge.ConstraintPairs.AddRange(constraintPairs); // TODO: Add more checking for this if (a.Joint != null && b.Joint != null) { var aJointType = a.Joint.JointType; var bJointType = b.Joint.JointType; if (aJointType != bJointType) { Logger.Instance.AddLogMessage("Mismatched joint type in connected Connectors.", Severity.Error); } else { edge.KinematicJointPair = new DataRep.KinematicJointPair(a.Joint, b.Joint); GMEIDJointIDMap.Add(a.Joint.CyPhyID, edge.KinematicJointPair.XmlID); GMEIDJointIDMap.Add(b.Joint.CyPhyID, edge.KinematicJointPair.XmlID); } } if (size2fit) { size2fitEdges.Add(edge); } else { regularEdges.Add(edge); } // TODO: !!!!!!!!!!!!!! NEED TO IMPLEMENT !!!!!!!!!!!!!! // Check for coordinatesystem datum should be the only 1 return(!result); }
private void FindMatchingSolidModelingFeatures(CyPhy.CADDatum datum, CyPhy.CADModel acadmodel) { // META-947: Creates a virtual connector DataRep.StructuralInterfaceConstraint sirep = new StructuralInterfaceConstraint(datum, this.Id, this.DisplayID); sirep.PopulateStructuralInterface(acadmodel); if (sirep.DatumList.Count > 0) { StructuralInterfaceNodes[datum.ID] = sirep; } }
private void FindMatchingSolidModelingFeatures(CyPhy.Connector a, CyPhy.CADModel acadmodel) { // META-947: Connector instead of StructuralInterface // [1] Connectors can be nested so find all cad datums within a connector recursively // [2] Find connected datums // Skip Connector without any Datum Ports DataRep.StructuralInterfaceConstraint sirep = new StructuralInterfaceConstraint(a, this.Id, this.DisplayID); sirep.PopulateStructuralInterface(acadmodel); if (sirep.DatumList.Count > 0) { StructuralInterfaceNodes[a.ID] = sirep; } }