Example #1
0
        /// <summary>
        /// Checks the integrity of the Chunk. Reports Error Messages if values are missing
        /// </summary>
        /// <returns></returns>
        public override CheckResult CheckIntegrity()
        {
            CheckResult result = new CheckResult();

            if (BoundingBox == null)
            {
                result.AddError("Bounding Box of Geometry is set to NULL!");
            }

            if (Segments.Count == 0)
            {
                result.AddError("Number of Segments in Geometry is zero! At least one Segment is necessary!");
            }

            try {
                result = CheckResult.Merge(result, CheckResult.Merge(Segments.ToArray()));
            }
            catch (ArgumentNullException ex) {
                result.AddError(ex.Message);
                return(result);
            }

            /*catch {
             *  throw;
             *  ///result.AddError("An Unknown Error occured! " + ex.Message);
             *  //return result;
             * }*/

            return(result);
        }
Example #2
0
        /// <summary>
        /// Checks the integrity of the Chunk. Reports Error Messages if values are missing
        /// </summary>
        /// <returns></returns>
        public override CheckResult CheckIntegrity() {
            CheckResult result = new CheckResult();

            if (Name == null) {
                result.AddError("Name of the Selection is set to NULL! Must be a string!");
            }

            if (FrameInformation == null) {
                result.AddError("Frame Information of the Selection is set to NULL!");
            }

            if (BoundingBox == null) {
                result.AddError("Bounding Box of the Selection is set to NULL!");
            }


            try {
                result = CheckResult.Merge(result, FrameInformation.CheckIntegrity(), BoundingBox.CheckIntegrity());
            }
            catch (ArgumentNullException ex) {
                result.AddError(ex.Message);
                return result;
            }
            catch (Exception ex) {
                result.AddError("An Unknown Error occured! " + ex.Message);
                return result;
            }

            return result;
        }
Example #3
0
        /// <summary>
        /// Does an integrity check to see if all values are properly set and in a valid range
        /// </summary>
        /// <returns>Contains all found errors</returns>
        public CheckResult CheckIntegrity()
        {
            CheckResult result = new CheckResult();

            //check for double uses of model indices
            for (int i = 0; i < Models.Count - 1; i++)
            {
                for (int j = i + 1; j < Models.Count; j++)
                {
                    if (Models[i].Index == Models[j].Index)
                    {
                        result.AddError(
                            string.Format(
                                "The Model Index {0} is used by both {1} and {2}",
                                Models[i].Index,
                                Models[i].Name,
                                Models[j].Name
                                )
                            );
                    }
                }
            }

            try {
                result = CheckResult.Merge(result, CheckResult.Merge(SelectionInformation));
                result = CheckResult.Merge(result, CheckResult.Merge(Materials.ToArray()));
                result = CheckResult.Merge(result, CheckResult.Merge(Models.ToArray()));
            }
            catch (ArgumentNullException ex) {
                result.AddError(ex.Message);
                return(result);
            }
            catch (Exception ex) {
                result.AddError("An Unknown Error occured! " + ex.Message);
                return(result);
            }

            return(result);
        }