Example #1
0
        /*--------------------------------------------------------------------------------------------*/
        public virtual void AddFactorCreatedByMember(ICreateOperationBuilder pCreCtx,
                                                     Factor pNewDom, CreateFabFactor pNewCre, IWeaverVarAlias <Factor> pAlias)
        {
            var a = AddEdge <Factor, FactorCreatedByMember, Member>(
                pCreCtx, pAlias, pNewCre.CreatedByMemberId);

            var mcfEdge = new MemberCreatesFactor();

            mcfEdge.Timestamp         = pNewDom.Timestamp;
            mcfEdge.DescriptorType    = pNewDom.DescriptorType;
            mcfEdge.PrimaryArtifactId = pNewCre.UsesPrimaryArtifactId;
            mcfEdge.RelatedArtifactId = pNewCre.UsesRelatedArtifactId;

            AddReverseEdge(pCreCtx, a, mcfEdge, pAlias);
        }
Example #2
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        private void AddFactor(SetupMemberId pMemId, SetupArtifactId pPrimArtId,
                               SetupArtifactId pRelArtId, DescriptorId pDescId, DirectorId?pDirId,
                               EventorId?pEventId, IdentorId?pIdentId, LocatorId?pLocId, VectorId?pVectId,
                               bool pIsDefining, FactorAssertion.Id pAstId, string pNote)
        {
            Descriptor desc = DescMap[(long)pDescId];

            var f = new Factor();

            f.AssertionType  = (byte)pAstId;
            f.IsDefining     = pIsDefining;
            f.Note           = pNote;
            f.DescriptorType = desc.Type;
            AddVertex(f, (SetupVertexId)(++vIdCount));

            ////

            Member mem = Data.GetVertex <Member>((long)pMemId);

            var mcf = new MemberCreatesFactor();

            mcf.Timestamp         = f.Timestamp;
            mcf.DescriptorType    = f.DescriptorType;
            mcf.PrimaryArtifactId = (long)pPrimArtId;
            mcf.RelatedArtifactId = (long)pRelArtId;

            AddEdge(mem, mcf, f);
            AddEdge(f, new FactorCreatedByMember(), mem);

            ////

            Artifact priArt = Data.GetVertex <Artifact>((long)pPrimArtId);
            Artifact relArt = Data.GetVertex <Artifact>((long)pRelArtId);

            var aupf = new ArtifactUsedAsPrimaryByFactor();

            aupf.Timestamp         = f.Timestamp;
            aupf.DescriptorType    = f.DescriptorType;
            aupf.RelatedArtifactId = relArt.VertexId;

            var aurf = new ArtifactUsedAsRelatedByFactor();

            aurf.Timestamp         = f.Timestamp;
            aurf.DescriptorType    = f.DescriptorType;
            aurf.PrimaryArtifactId = priArt.VertexId;

            AddEdge(priArt, aupf, f);
            AddEdge(relArt, aurf, f);
            AddEdge(f, new FactorUsesPrimaryArtifact(), priArt);
            AddEdge(f, new FactorUsesRelatedArtifact(), relArt);

            ////

            if (desc.PrimArtRefId != null)
            {
                AddEdge(f, new FactorDescriptorRefinesPrimaryWithArtifact(),
                        Data.GetVertex <Artifact>((long)desc.PrimArtRefId));
            }

            if (desc.TypeArtRefId != null)
            {
                AddEdge(f, new FactorDescriptorRefinesTypeWithArtifact(),
                        Data.GetVertex <Artifact>((long)desc.TypeArtRefId));
            }

            if (desc.RelArtRefId != null)
            {
                AddEdge(f, new FactorDescriptorRefinesRelatedWithArtifact(),
                        Data.GetVertex <Artifact>((long)desc.RelArtRefId));
            }

            if (pDirId != null)
            {
                Director dir = DirMap[(long)pDirId];
                f.DirectorType          = dir.Type;
                f.DirectorPrimaryAction = dir.PrimaryDirectorActionId;
                f.DirectorRelatedAction = dir.RelatedDirectorActionId;
            }

            if (pEventId != null)
            {
                Eventor e = EveMap[(long)pEventId];
                f.EventorType     = e.Type;
                f.EventorDateTime = e.DateTime;
            }

            if (pIdentId != null)
            {
                Identor i = IdenMap[(long)pIdentId];
                f.IdentorType  = i.Type;
                f.IdentorValue = i.Value;
            }

            if (pLocId != null)
            {
                Locator l = LocMap[(long)pLocId];
                f.LocatorType   = l.Type;
                f.LocatorValueX = l.ValueX;
                f.LocatorValueY = l.ValueY;
                f.LocatorValueZ = l.ValueZ;
            }

            if (pVectId != null)
            {
                Vector v = VecMap[(long)pVectId];
                f.VectorType       = v.Type;
                f.VectorUnit       = v.Unit;
                f.VectorUnitPrefix = v.UnitPrefix;
                f.VectorValue      = v.Value;
                AddEdge(f, new FactorVectorUsesAxisArtifact(), Data.GetVertex <Artifact>(v.AxisArtId));
            }

            Data.ElapseTime();
        }