Ejemplo n.º 1
0
        public Knot(
            ClosedCurve curve,
            OculusTouch oculusTouch,
            float distanceThreshold        = -1,
            List <Curve>?collisionCurves   = null,
            LogicalButton?buttonA          = null,
            LogicalButton?buttonB          = null,
            LogicalButton?buttonC          = null,
            LogicalButton?buttonD          = null,
            Material?curveMaterial         = null,
            Material?pullableCurveMaterial = null,
            Material?pointMaterial         = null
            )
        {
            buttonA = buttonA ?? LogicalOVRInput.RawButton.A;
            buttonB = buttonB ?? LogicalOVRInput.RawButton.B;
            buttonC = buttonC ?? LogicalOVRInput.RawButton.RIndexTrigger;
            buttonD = buttonD ?? LogicalOVRInput.RawButton.RHandTrigger;
            int count = curve.GetPoints().Count;

            (int first, int second)chosenPoints = (count / 3, 2 * count / 3);
            KnotData data = new KnotData(curve, chosenPoints, oculusTouch, distanceThreshold, collisionCurves,
                                         buttonA, buttonB, buttonC, buttonD, curveMaterial, pullableCurveMaterial, pointMaterial);

            this.state = new KnotStateBase(data);

            HandCurve.SetUp(oculusTouch, drawButton: buttonC, moveButton: buttonD);
        }
Ejemplo n.º 2
0
    public void OnGoClicked()
    {
        ClosedCurve curve = new ClosedCurve(gaussCode.text,
                                            markedCrossings.text);

        fText.text = curve.toString();
    }
Ejemplo n.º 3
0
        protected override void setJSON(JObject obj, BaseClassIfc host, SetJsonOptions options)
        {
            base.setJSON(obj, host, options);
            obj["Degree"] = Degree;
            JArray array = new JArray();

            foreach (IfcCartesianPoint point in ControlPointsList)
            {
                array.Add(point.getJson(this, options));
            }
            obj["ControlPointsList"] = array;
            obj["CurveForm"]         = CurveForm.ToString();
            obj["ClosedCurve"]       = ClosedCurve.ToString();
            obj["SelfIntersect"]     = SelfIntersect.ToString();
        }
Ejemplo n.º 4
0
        public override string GetStepParameters()
        {
            var parameters = new List <string>();

            parameters.Add(Degree != null ? Degree.ToStepValue() : "$");
            parameters.Add(ControlPointsList != null ? ControlPointsList.ToStepValue() : "$");
            parameters.Add(CurveForm != null ? CurveForm.ToStepValue() : "$");
            parameters.Add(ClosedCurve != null ? ClosedCurve.ToStepValue() : "$");
            parameters.Add(SelfIntersect != null ? SelfIntersect.ToStepValue() : "$");
            parameters.Add(KnotMultiplicities != null ? KnotMultiplicities.ToStepValue() : "$");
            parameters.Add(Knots != null ? Knots.ToStepValue() : "$");
            parameters.Add(KnotSpec != null ? KnotSpec.ToStepValue() : "$");

            return(string.Join(", ", parameters.ToArray()));
        }
Ejemplo n.º 5
0
        protected override void setJSON(JObject obj, BaseClassIfc host, HashSet <int> processed)
        {
            base.setJSON(obj, host, processed);
            obj["Degree"] = Degree;
            JArray array = new JArray();
            List <IfcCartesianPoint> controlPoints = ControlPointsList;

            foreach (IfcCartesianPoint point in controlPoints)
            {
                array.Add(point.getJson(this, processed));
            }
            obj["ControlPointsList"] = array;
            obj["CurveForm"]         = CurveForm.ToString();
            obj["ClosedCurve"]       = ClosedCurve.ToString();
            obj["SelfIntersect"]     = SelfIntersect.ToString();
        }
        /// <summary>
        /// Tests the express where-clause specified in param 'clause'
        /// </summary>
        /// <param name="clause">The express clause to test</param>
        /// <returns>true if the clause is satisfied.</returns>
        public bool ValidateClause(IfcCompositeCurveClause clause)
        {
            var retVal = false;

            try
            {
                switch (clause)
                {
                case IfcCompositeCurveClause.CurveContinuous:
                    retVal = ((!ClosedCurve.AsBool()) && (Functions.SIZEOF(Segments.Where(Temp => Temp.Transition == IfcTransitionCode.DISCONTINUOUS)) == 1)) || ((ClosedCurve.AsBool()) && (Functions.SIZEOF(Segments.Where(Temp => Temp.Transition == IfcTransitionCode.DISCONTINUOUS)) == 0));
                    break;

                case IfcCompositeCurveClause.SameDim:
                    retVal = Functions.SIZEOF(Segments.Where(Temp => Temp.Dim != Segments.ItemAt(0).Dim)) == 0;
                    break;
                }
            } catch (Exception ex) {
                var log = Validation.ValidationLogging.CreateLogger <Xbim.Ifc4.GeometryResource.IfcCompositeCurve>();
                log?.LogError(string.Format("Exception thrown evaluating where-clause 'IfcCompositeCurve.{0}' for #{1}.", clause, EntityLabel), ex);
            }
            return(retVal);
        }
Ejemplo n.º 7
0
 public void AddClosedCurve(ClosedCurve closedCurve)
 {
     closedCurves.Add(closedCurve);
 }