Exemple #1
0
        public CreatePlane(ref Scene scene, CurveID curveID) : base(ref scene)
        {
            beforeCurveCount = mScene.iCurveList.Count;

            mesh_m = new Material.SingleColorMaterial(0.5f, 0.5f, 0, 0.4f);

            if (curveID == CurveID.ProfileCurve1)
            {
                shapeType = (ShapeType)mScene.selectionDic[SelectionKey.Profile1Shape];
                drawnType = (DrawnType)mScene.selectionDic[SelectionKey.Profile1On];
            }
            else if (curveID == CurveID.ProfileCurve2)
            {
                shapeType = (ShapeType)mScene.selectionDic[SelectionKey.Profile2Shape];
                drawnType = (DrawnType)mScene.selectionDic[SelectionKey.Profile2On];
            }

            if (scene.isOculus)
            {
                mMinSelectionRadius = 0.2f;
            }
            else
            {
                mMinSelectionRadius = 0.4f;
            }
        }
Exemple #2
0
        public CreateCurve(ref Scene scene, bool _isClosed, CurveID curveID) : base(ref scene)
        {
            beforeCurveCount = mScene.iCurveList.Count;
            stroke_g         = new Geometry.GeometryStroke(ref mScene);
            stroke_m         = new Material.SingleColorMaterial(1, 0, 0, 1);
            mesh_m           = new Material.RGBNormalMaterial(0.5f);
            railPlane_m      = new Material.SingleColorMaterial(34f / 255f, 139f / 255f, 34f / 255f, 0.4f);
            isClosed         = _isClosed;
            rayCastingObjs   = new List <ObjRef>();

            resetVariables();

            FunctionType modelFun = (FunctionType)mScene.selectionDic[SelectionKey.ModelFun];

            //0:3D, 1:onDPlanes, 2: onSurfaces, 3: onTargets
            if (curveID == CurveID.ProfileCurve1)
            {
                drawnType = (DrawnType)mScene.selectionDic[SelectionKey.Profile1On];
                //Revolve only needs 1 profilecurve in our case
                if (modelFun == FunctionType.Revolve)
                {
                    dynamicRender = "Revolve";
                }
            }
            else if (curveID == CurveID.ProfileCurve2)
            {
                drawnType = (DrawnType)mScene.selectionDic[SelectionKey.Profile2On];

                //need to visualize the model

                switch (modelFun)
                {
                case FunctionType.Extrude:
                    dynamicRender = "Extrude";
                    break;

                case FunctionType.Loft:
                    dynamicRender = "Loft";
                    break;

                case FunctionType.Sweep:
                    dynamicRender = "Sweep";
                    break;
                }
            }

            /*
             * foreach(Curve c in mScene.iCurveList)
             * {
             *  localListCurve.Add(c);
             * }
             */

            //testing
            localListCurve = mScene.iCurveList;
        }
Exemple #3
0
        public AddPoint(ref Scene scene, int num, CurveID curveID) : base(ref scene)
        {
            mScene           = scene;
            beforeCurveCount = mScene.iCurveList.Count;
            point_g          = new Geometry.PointMarker(new Vector3());
            point_m          = new Material.SingleColorMaterial(0f, .5f, 1f, 1f);

            if (curveID == CurveID.ProfileCurve1)
            {
                drawnType = (DrawnType)mScene.selectionDic[SelectionKey.Profile1On];
                shapeType = (ShapeType)mScene.selectionDic[SelectionKey.Profile1Shape];
            }
            else if (curveID == CurveID.ProfileCurve2)
            {
                drawnType = (DrawnType)mScene.selectionDic[SelectionKey.Profile2On];
                shapeType = (ShapeType)mScene.selectionDic[SelectionKey.Profile2Shape];
            }

            maxNumPoint    = num;
            profile_m      = new Material.SingleColorMaterial(0.5f, 0, 0, 0.4f);
            rayCastingObjs = new List <ObjRef>();

            resetVariables();
        }
Exemple #4
0
 public serverHelloMsg(slice <byte> raw = default, ushort vers = default, slice <byte> random = default, slice <byte> sessionId = default, ushort cipherSuite = default, byte compressionMethod = default, bool ocspStapling = default, bool ticketSupported = default, bool secureRenegotiationSupported = default, slice <byte> secureRenegotiation = default, @string alpnProtocol = default, slice <slice <byte> > scts = default, ushort supportedVersion = default, keyShare serverShare = default, bool selectedIdentityPresent = default, ushort selectedIdentity = default, slice <byte> supportedPoints = default, slice <byte> cookie = default, CurveID selectedGroup = default)
 {
     this.raw                          = raw;
     this.vers                         = vers;
     this.random                       = random;
     this.sessionId                    = sessionId;
     this.cipherSuite                  = cipherSuite;
     this.compressionMethod            = compressionMethod;
     this.ocspStapling                 = ocspStapling;
     this.ticketSupported              = ticketSupported;
     this.secureRenegotiationSupported = secureRenegotiationSupported;
     this.secureRenegotiation          = secureRenegotiation;
     this.alpnProtocol                 = alpnProtocol;
     this.scts                         = scts;
     this.supportedVersion             = supportedVersion;
     this.serverShare                  = serverShare;
     this.selectedIdentityPresent      = selectedIdentityPresent;
     this.selectedIdentity             = selectedIdentity;
     this.supportedPoints              = supportedPoints;
     this.cookie                       = cookie;
     this.selectedGroup                = selectedGroup;
 }
Exemple #5
0
 public nistParameters(slice <byte> privateKey = default, ref ptr <big.Int> x = default, ref ptr <big.Int> y = default, CurveID curveID = default)
 {
     this.privateKey = privateKey;
     this.x          = x;
     this.y          = y;
     this.curveID    = curveID;
 }
Exemple #6
0
 public keyShare(CurveID group = default, slice <byte> data = default)
 {
     this.group = group;
     this.data  = data;
 }
Exemple #7
0
        private void initInteractionChain(CurveID curveID)
        {
            //0-Surface, 1-3D, 2-Plane, 3-Reference
            interactionChain.Clear();
            //always remove from the last
            if (mScene.mIChainsList.Count > 0)
            {
                mScene.mIChainsList.RemoveAt(mScene.mIChainsList.Count - 1);
            }

            FunctionType modelFun  = (FunctionType)mScene.selectionDic[SelectionKey.ModelFun];
            ShapeType    shapeType = ShapeType.None;
            DrawnType    drawnType = DrawnType.None;
            AxisType     axisType  = AxisType.None;
            MarkingMenu  nextMenu  = null;

            if (curveID == CurveID.ProfileCurve1)
            {
                if (modelFun == FunctionType.Loft)
                {
                    shapeType = (ShapeType)mScene.selectionDic[SelectionKey.Profile1Shape];
                    drawnType = (DrawnType)mScene.selectionDic[SelectionKey.Profile1On];
                    if (shapeType == ShapeType.Curve)
                    {
                        nextMenu = new MarkingMenu(ref mScene, MenuLayout2.LoftC2D2);
                    }
                    else
                    {
                        nextMenu = new MarkingMenu(ref mScene, MenuLayout2.LoftC2);
                    }

                    nextMenu.setVisible(true);
                    pushInteractionChain(nextMenu);
                }
                else if (modelFun == FunctionType.Sweep)
                {
                    shapeType = (ShapeType)mScene.selectionDic[SelectionKey.Profile1Shape];
                    drawnType = (DrawnType)mScene.selectionDic[SelectionKey.Profile1On];
                    nextMenu  = new MarkingMenu(ref mScene, MenuLayout2.SweepC2D2);
                    nextMenu.setVisible(true);
                    pushInteractionChain(nextMenu);
                }
                else if (modelFun == FunctionType.Extrude)
                {
                    shapeType = (ShapeType)mScene.selectionDic[SelectionKey.Profile1Shape];
                    drawnType = (DrawnType)mScene.selectionDic[SelectionKey.Profile1On];
                    nextMenu  = new MarkingMenu(ref mScene, MenuLayout2.ExtrudeC2D2);
                    nextMenu.setVisible(true);
                    pushInteractionChain(nextMenu);
                }
                else if (modelFun == FunctionType.Revolve)
                {
                    shapeType = (ShapeType)mScene.selectionDic[SelectionKey.Profile1Shape];
                    drawnType = (DrawnType)mScene.selectionDic[SelectionKey.Profile1On];
                    axisType  = (AxisType)mScene.selectionDic[SelectionKey.RevolveAxis];
                }
            }
            else if (curveID == CurveID.ProfileCurve2)
            {
                if (modelFun == FunctionType.Loft)
                {
                    /*
                     * if (mScene.selectionDic.ContainsKey(SelectionKey.CurveOn))
                     * {
                     *  shapeType = ShapeType.Curve;
                     *  drawnType = (DrawnType)mScene.selectionDic[SelectionKey.CurveOn];
                     * }
                     * else
                     * {
                     *  shapeType = (ShapeType)mScene.selectionDic[SelectionKey.Profile2Shape];
                     *  drawnType = (DrawnType)mScene.selectionDic[SelectionKey.Profile2On];
                     *
                     * }*/
                    shapeType = (ShapeType)mScene.selectionDic[SelectionKey.Profile2Shape];
                    drawnType = (DrawnType)mScene.selectionDic[SelectionKey.Profile2On];
                }
                else if (modelFun == FunctionType.Sweep || modelFun == FunctionType.Extrude)
                {
                    ShapeType shapeType1 = (ShapeType)mScene.selectionDic[SelectionKey.Profile1Shape];
                    DrawnType drawnType1 = (DrawnType)mScene.selectionDic[SelectionKey.Profile1On];

                    shapeType = ShapeType.Curve;
                    drawnType = (DrawnType)mScene.selectionDic[SelectionKey.Profile2On];
                    //add the editing end cap interactaion here
                    if (shapeType1 == ShapeType.Circle || shapeType1 == ShapeType.Rect)
                    {
                        pushInteractionChain(new EditPoint(ref mScene, CurveID.EndCapCurve));
                    }
                }
            }

            if (drawnType == DrawnType.Surface)
            {
                if (shapeType == ShapeType.Rect)
                {
                    pushInteractionChain(new EditPoint(ref mScene, curveID));
                    pushInteractionChain(new AddPoint(ref mScene, 2, curveID));
                }
                else if (shapeType == ShapeType.Circle)
                {
                    pushInteractionChain(new EditPoint(ref mScene, curveID));
                    pushInteractionChain(new AddPoint(ref mScene, 2, curveID));
                }
                else if (shapeType == ShapeType.Curve)
                {
                    pushInteractionChain(new EditPoint(ref mScene, curveID));
                    pushInteractionChain(new CreateCurve(ref mScene, false, curveID));
                }

                /*
                 * else if (mScene.selectionList[index] == "Patch")
                 * {
                 *  mScene.mInteractionChian.Push(new CreatePatch(ref mScene));
                 * }*/
            }
            else if (drawnType == DrawnType.In3D)
            {
                if (shapeType == ShapeType.Circle)
                {
                    pushInteractionChain(new EditPoint(ref mScene, curveID));
                    pushInteractionChain(new CreatePlane(ref mScene, curveID));
                }
                else if (shapeType == ShapeType.Rect)
                {
                    pushInteractionChain(new EditPoint(ref mScene, curveID));
                    pushInteractionChain(new CreatePlane(ref mScene, curveID));
                }
                else if (shapeType == ShapeType.Curve)
                {
                    pushInteractionChain(new EditPoint(ref mScene, curveID));
                    pushInteractionChain(new CreateCurve(ref mScene, false, curveID));
                }
            }
            else if (drawnType == DrawnType.Plane)
            {
                if (shapeType == ShapeType.Rect)
                {
                    pushInteractionChain(new EditPoint(ref mScene, curveID));
                    pushInteractionChain(new AddPoint(ref mScene, 2, curveID));
                }
                else if (shapeType == ShapeType.Circle)
                {
                    pushInteractionChain(new EditPoint(ref mScene, curveID));
                    pushInteractionChain(new AddPoint(ref mScene, 2, curveID));
                }
                else if (shapeType == ShapeType.Curve)
                {
                    pushInteractionChain(new EditPoint(ref mScene, curveID));
                    pushInteractionChain(new CreateCurve(ref mScene, false, curveID));
                }

                /*
                 * else if (mScene.selectionList[index] == "Patch")
                 * {
                 *  mScene.mInteractionChian.Push(new CreatePatch(ref mScene, true));
                 * }*/
            }
            else if (drawnType == DrawnType.Reference)
            {
                if (shapeType == ShapeType.Rect)
                {
                    pushInteractionChain(new EditPoint(ref mScene, curveID));
                    //mScene.mInteractionChian.Push(new AddPoint(ref mScene, 2, curveID));
                    pushInteractionChain(new CreatePlane(ref mScene, curveID));
                }
                else if (shapeType == ShapeType.Circle)
                {
                    pushInteractionChain(new EditPoint(ref mScene, curveID));
                    //mScene.mInteractionChian.Push(new AddPoint(ref mScene, 2, curveID));
                    pushInteractionChain(new CreatePlane(ref mScene, curveID));
                }
                else if (shapeType == ShapeType.Curve)
                {
                    pushInteractionChain(new EditPoint(ref mScene, curveID));
                    pushInteractionChain(new CreateCurve(ref mScene, false, curveID));
                }

                /*
                 * else if (mScene.selectionList[index] == "Patch")
                 * {
                 *  mScene.mInteractionChian.Push(new CreatePatch(ref mScene));
                 * }*/
            }

            mScene.mIChainsList.Add(interactionChain);
        }