Beispiel #1
0
        /// <summary>
        /// Generate the key points with the computational domain information.
        /// There's always only two keypoints in each axis in this version
        /// </summary>
        private void GenerateKeyPoints(GEMSComputationalDomain domain, float xMeshSize, float yMeshSize, float zMeshSize)
        {
            keyPointsInX.Clear( );
            keyPointsInY.Clear( );
            keyPointsInZ.Clear( );

            //X Axis
            float        length   = domain.MaxX - domain.MinX;
            GEMSKeyPoint keyPoint = new GEMSKeyPoint(domain.MinX, xMeshSize, length);

            keyPointsInX.Add(keyPoint);
            keyPoint = new GEMSKeyPoint(domain.MaxX, xMeshSize, length);
            keyPointsInX.Add(keyPoint);

            //Y Axis
            length   = domain.MaxY - domain.MinY;
            keyPoint = new GEMSKeyPoint(domain.MinY, yMeshSize, length);
            keyPointsInY.Add(keyPoint);
            keyPoint = new GEMSKeyPoint(domain.MaxY, yMeshSize, length);
            keyPointsInY.Add(keyPoint);

            //Z Axis
            length   = domain.MaxZ - domain.MinZ;
            keyPoint = new GEMSKeyPoint(domain.MinZ, zMeshSize, length);
            keyPointsInZ.Add(keyPoint);
            keyPoint = new GEMSKeyPoint(domain.MaxZ, zMeshSize, length);
            keyPointsInZ.Add(keyPoint);
        }
Beispiel #2
0
        /// <summary>
        /// Read the key points in one axis from xml file
        /// </summary>
        private void ReadKeyPointsInOneAxis(Axis axis, XPathNavigator navigator, List <GEMSKeyPoint> keyPoints)
        {
            //Find this direction
            XPathNavigator directionNode = navigator.SelectSingleNode("/Document/KeyPoints[@direction='" + axis.ToString( ).ToUpper( ) + "']");

            if (directionNode == null)
            {
                return;
            }

            //Get the key points
            XPathNodeIterator nodes = directionNode.SelectChildren("KeyPoint", string.Empty);

            while (nodes.MoveNext( ))
            {
                XPathNavigator keyPointNavigator = nodes.Current.Clone( );

                GEMSKeyPoint keyPoint = new GEMSKeyPoint(keyPointNavigator);

                keyPoints.Add(keyPoint);
            }
        }