Пример #1
0
 internal ShapeContainer(uint spid, ShapeType shapeType, ShapeFlag shapeFlags, ClientAnchor.SPRC clientAnchorInfo, uint refIndex, string imageName, string hyperLinkName, HyperlinkType hyperLinkType)
     : base(15, 0u, EscherType.MSOFBTSPCONTAINER, 0u)
 {
     m_shape        = new Shape(shapeType, shapeFlags, spid);
     m_drawingOpt   = new DrawingOpt(imageName, refIndex, hyperLinkName, hyperLinkType);
     m_clientAnchor = new ClientAnchor(clientAnchorInfo);
     m_clientData   = new ClientData();
 }
Пример #2
0
            public override void OnContactNotify(ContactPair contactInformation, ContactPairFlag events)
            {
                ContactStreamIterator iter;

                using (iter = new ContactStreamIterator(contactInformation.ContactStream))
                {
                    while (iter.GoToNextPair())
                    {
                        while (iter.GoToNextPatch())
                        {
                            while (iter.GoToNextPoint())
                            {
                                // Test each of the available 'information' functions/properties

                                int       numberOfPairs            = iter.GetNumberOfPairs();
                                Shape     shapeA                   = iter.GetShapeA();
                                Shape     shapeB                   = iter.GetShapeB();
                                bool      isShapeADeleted          = iter.IsDeletedShapeA();
                                bool      isShapeBDeleted          = iter.IsDeletedShapeB();
                                ShapeFlag shapeFlags               = iter.GetShapeFlags();
                                int       numberOfPatches          = iter.GetNumberOfPatches();
                                int       numberOfPatchesRemaining = iter.GetNumberOfPatchesRemaining();
                                Vector3   patchNormal              = iter.GetPatchNormal();
                                int       numberOfPoints           = iter.GetNumberOfPoints();
                                int       numberOfPointsRemaining  = iter.GetNumberOfPointsRemaining();
                                Vector3   point            = iter.GetPoint();
                                float     separation       = iter.GetSeperation();
                                int       featureIndex0    = iter.GetFeatureIndex0();
                                int       featureIndex1    = iter.GetFeatureIndex1();
                                float     pointNormalForce = iter.GetPointNormalForce();

                                // First collision should be AB
                                if (IsPairContacting(shapeA, A, B) && IsPairContacting(shapeB, A, B))
                                {
                                    ABHitCallback();
                                }

                                // Second collision should be BC, but only if AB has happened
                                if (IsPairContacting(shapeA, B, C) && IsPairContacting(shapeB, B, C))
                                {
                                    BCHitCallback();
                                }
                            }
                        }
                    }
                }

                Assert.IsTrue(iter.IsDisposed);
            }
Пример #3
0
 internal ShapeContainer(uint spid, ShapeType shapeType, ShapeFlag shapeFlags)
     : base(15, 0u, EscherType.MSOFBTSPCONTAINER, 0u)
 {
     m_shapeGroup = new ShapeGroup(0u, 0u, 0u, 0u);
     m_shape      = new Shape(shapeType, shapeFlags, spid);
 }
Пример #4
0
 internal Shape(ShapeType shapeType, ShapeFlag shapeFlags, uint spid)
     : base(2, (uint)shapeType, EscherType.MSOFBTSP, 8u)
 {
     m_spid      = spid;
     m_shapeFlag = shapeFlags;
 }