public EmbreeIndexedGeometry(Device device, IndexedGeometry ig)
        {
            var pa = (V3f[])ig.IndexedAttributes[DefaultSemantic.Positions];
            var ia = (int[])ig.IndexArray;

            EmbreeGeometry  = new TriangleGeometry(device, pa, ia, RTCBuildQuality.High);
            IndexedGeometry = ig;
        }
Exemple #2
0
        public void TestTriangleSquare(double a, double b, double c, double testSquare)
        {
            TriangleGeometry t = (TriangleGeometry)builder.BuildTriangleBySides(a, b, c);
            var square         = t.Square();
            var isRightAngle   = t.IsRightAngle();

            Assert.AreEqual(square, testSquare);
            Assert.AreEqual(isRightAngle, true);
        }
Exemple #3
0
        public void Process(string[] args)            //Process with arguments tested by their quantity
        {
            if (!AllParse(args))
            {
                OutputResults.OutputMessage(OutputResults.APP_CANNOT_PROCESS);
                OutputResults.OutputMessage(OutputResults.CAN_RESTART);
            }

            OutputResults.OutputMessage(DATA_ENTERED);

            if (TriangleGeometry.IsTriangle(_sides))
            {
                Triangle triangle = new Triangle(_sides);
                _triangles.Add(_name, triangle);

                OutputResults.ShowTriangleWithSquare(this as IViewable, _triangles.Last().Key);
            }
            else
            {
                OutputResults.OutputMessage(ERR_NOT_TRIANGLE);
            }
        }
Exemple #4
0
        /// <summary>
        /// Process console entery data for one trieangle.
        /// </summary>
        /// <returns>If the user wants to continue, returns false, else returns true.</returns>
        public bool Process()                                                    //Process with console data
        {
            if (!AllParse())                                                     //User's data are incorrect
            {
                if (!Input.AskContinue(OutputResults.ASK_CONTINUE_WITH_CONSOLE)) //User don't want to continue
                {
                    OutputResults.OutputMessage(OutputResults.CAN_RESTART);
                    OutputResults.OutputMessage(OutputResults.FINISH);
                    Console.ReadLine();

                    return(false);
                }

                return(true);      //User want to continue
            }

            //OutputResults.OutputMessage(DATA_ENTERED);

            if (TriangleGeometry.IsTriangle(_sides))
            {
                Triangle triangle = new Triangle(_sides);
                _triangles.Add(_name, triangle);

                triangle.ShowTriangleWithSquare(_name);
                OutputResults.ShowTriangleWithSquare(this as IViewable, _triangles.Last().Key);

                if (!Input.AskContinue(OutputResults.ASK_CONTINUE_WITH_CONSOLE))  //Ask about the continuation of the application
                {
                    OutputResults.OutputMessage(OutputResults.CAN_RESTART);
                    OutputResults.OutputMessage(OutputResults.FINISH);
                    Console.ReadLine();

                    return(false);         //User don't want to continue
                }

                return(true);     //User want to continue
            }
            else
            {
                OutputResults.OutputMessage(ERR_NOT_TRIANGLE);

                if (!Input.AskContinue(OutputResults.ASK_CONTINUE_WITH_CONSOLE))    //Ask about the continuation of the application
                {
                    OutputResults.OutputMessage(OutputResults.CAN_RESTART);
                    OutputResults.OutputMessage(OutputResults.FINISH);
                    Console.ReadLine();

                    return(false);     //User don't want to continue
                }

                return(true);          //User want to continue
            }

            if (!Input.AskContinue(OutputResults.ASK_CONTINUE_WITH_CONSOLE))
            {
                OutputResults.OutputMessage(OutputResults.CAN_RESTART);
                OutputResults.OutputMessage(OutputResults.FINISH);
                Console.ReadLine();

                return(false);
            }

            return(true);
        }
 public void Dispose()
 {
     EmbreeGeometry.Dispose();
     EmbreeGeometry = null;
 }