Example #1
0
        /// <summary>
        ///对一个射线管进行处理
        /// </summary>
        /// <param name="paramModel">射线管</param>
        ///  <param name="rayTubeModels">射线管的栈</param>
        /// <returns></returns>
        private void HandleTheRayTubeModel(RayTubeModel paramModel, Stack <RayTubeModel> rayTubeModels, ReceiveArea reArea, List <RayTubeModel>[] newRayTubes,
                                           double lengthX, double lengthY)
        {
            if (paramModel.JudgeIfThisModelNeedToBeDivided())//判断射线管是否需要进行细分
            {
                int divisionNum = paramModel.GetDivisionNumOfLine(lengthX, lengthY);
                List <RayTubeModel> newModels = paramModel.GetDivisionRayTubeModels(divisionNum);//细分后的射线管模型,将细分后的射线管压入栈中
                for (int i = 0; i < newModels.Count; i++)
                {
                    rayTubeModels.Push(newModels[i]);//加入栈中
                }
            }
            else//射线管不需要细分
            {
                //进入此环节的射线管已经完成了与地面和建筑物的求交计算,并且射线管不需要再细分
                //判断射线管有没有到达态势区域
                paramModel.UpdateAreaSituationFlag(reArea);                  //判断射线管有没有到达态势区域
                if (paramModel.IsReachingArea)                               //若射线管到达态势区域
                {
                    for (int i = 0; i < paramModel.crossLayerNum.Count; i++) //依次读取当前射线管中crossLayerNum的信息
                    {
                        int num = paramModel.crossLayerNum[i];
                        newRayTubes[num].Add((RayTubeModel)paramModel.Clone());//将射线管添加到对应的newRayTubes中
                    }
                }

                if (paramModel.ReflectionTracingTimes + paramModel.DiffractionTracingTimes >= 4 ||
                    paramModel.DiffractionTracingTimes >= 2)     //判断射线管是否满足截止条件
                {
                    return;
                }
                else//获取射线管下一阶段的射线管模型
                {
                    List <RayTubeModel> nextModels = paramModel.GetNextRayTubeModels();//下一阶段射线管模型
                    for (int i = 0; i < nextModels.Count; i++)
                    {
                        rayTubeModels.Push(nextModels[i]);//加入栈中
                    }
                }
            }
        }
Example #2
0
 /// <summary>
 ///对一个射线管进行处理
 /// </summary>
 /// <param name="paramModel">射线管</param>
 ///  <param name="rayTubeModels">射线管的栈</param>
 /// <returns></returns>
 private void HandleTheRayTubeModel(RayTubeModel paramModel, Stack <RayTubeModel> rayTubeModels, double lengthX, double lengthY)
 {
     if (paramModel.JudgeIfThisModelNeedToBeDivided())//若射线管需要进行细分
     {
         int divisionNum = paramModel.GetDivisionNumOfLine(lengthX, lengthY);
         List <RayTubeModel> newModels = paramModel.GetDivisionRayTubeModels(divisionNum);//细分后的射线管模型
         for (int i = 0; i < newModels.Count; i++)
         {
             if (newModels[i].OneRayModels[0].LaunchNode.Position != null && newModels[i].OneRayModels[1].LaunchNode.Position != null &&
                 newModels[i].OneRayModels[2].LaunchNode.Position != null)
             {
                 rayTubeModels.Push(newModels[i]);//加入栈中
                 //CalLog.LogForCal.WriteMsg(newModels[i].OneRayModels[0].LaunchNode.Position.X.ToString("0.#######E+00")
                 //    + "***" + newModels[i].OneRayModels[0].LaunchNode.Position.Y.ToString("0.#######E+00") + "***"
                 //    + newModels[i].OneRayModels[0].LaunchNode.Position.Z.ToString("0.#######E+00") + "////" + "3");
             }
         }
     }
     else//射线管不需要细分
     {
         if (paramModel.ReflectionTracingTimes + paramModel.DiffractionTracingTimes >= 4 ||
             paramModel.DiffractionTracingTimes >= 2 || paramModel.PassTracingTimes >= 10)   //若射线管满足截止条件
         {
             return;
         }
         else//获取射线管下一阶段的射线管模型
         {
             List <RayTubeModel> nextModels = paramModel.GetNextRayTubeModels();//下一阶段射线管模型
             for (int i = 0; i < nextModels.Count; i++)
             {
                 if (nextModels[i].OneRayModels[0].LaunchNode.Position != null && nextModels[i].OneRayModels[1].LaunchNode.Position != null &&
                     nextModels[i].OneRayModels[2].LaunchNode.Position != null)
                 {
                     rayTubeModels.Push(nextModels[i]);//加入栈中
                 }
             }
         }
     }
 }