示例#1
0
 /// <summary>
 ///得到ReflectionPoint节点,并加入child节点的子节点List中
 /// </summary>
 private void SetReflectionChildNode(Node fatherNode, Node reNode, Terrain ter, City cityBuilding, ReceiveBall rxBall, double rayBeamAngle, List <FrequencyBand> txFrequencyBand)
 {
     reNode.LayNum              = fatherNode.LayNum + 1;
     reNode.DiffractionNum      = fatherNode.DiffractionNum;
     reNode.IsReceiver          = false;
     reNode.UAN                 = rxBall.UAN;
     reNode.RayTracingDistance  = fatherNode.RayTracingDistance;
     reNode.RayTracingDistance += reNode.DistanceToFrontNode;
     reNode.RayIn               = new RayInfo(fatherNode.Position, reNode.Position);
     //当新节点的层数加绕射次数不小于4或者绕射次数大于2,说明该路径已经过三次反射(或两次反射一次绕射)或者两次绕射,舍弃并追踪下一条射线
     //将该节点设为end
     if ((reNode.DiffractionNum >= 2) || ((reNode.LayNum + reNode.DiffractionNum) >= 4))
     {
         reNode.IsEnd = true;
         //        reNode.NodeStyle = NodeStyle.FinalNode;
         fatherNode.ChildNodes.Add(reNode);
     }
     //否则,递归调用该函数继续追踪射线
     else
     {
         reNode.IsEnd = false;
         fatherNode.ChildNodes.Add(reNode);
         RayInfo        ReflectionRay = reNode.RayIn.GetReflectionRay(reNode.ReflectionFace, reNode.Position);
         PunctiformPath newPath       = new PunctiformPath(ReflectionRay, ter);
         newPath.SetPunctiformRayPathNodes(reNode, ter, rxBall, cityBuilding, rayBeamAngle, txFrequencyBand);
     }
 }