Example #1
0
		public static SectorOctree[] Sectores(Octree Octree, Recta3D Recta)
		{
			SectorOctree S = Octree.SectorRaiz;
			List<SectorOctree> Retorno = new List<SectorOctree>();

			if (Octree.SectorRaiz.Pertenece(ref Recta)) {
				InterseccionRecta(Recta, S, ref Retorno);

				return Retorno.ToArray();
			} else {
				throw new ExcepcionGeometrica3D("OCTREE (PERTENECE): La recta especificado no pertenece al espacio dominado por el quadtree." + Constants.vbNewLine + "Recta=" + Recta.ToString() + Constants.vbNewLine + "Espacio=" + Octree.Espacio.ToString());
			}
		}
Example #2
0
		public static SectorOctree Sector(Octree Octree, ref Poliedro Poliedro, bool CajaSUR = false)
		{
			int Resultado = Octree.SectorRaiz.Pertenece(ref Poliedro, CajaSUR);
			SectorOctree S = Octree.SectorRaiz;

			//PARA ENTENDER EL ALGORITMO, IR A FUNCION PERTENECE DE SECTORQUADTREE.
			if (Resultado != -2) {
				if (Resultado == -1) {
					return Octree.SectorRaiz;
				} else {
					do {
						if (Resultado != -2) {
							if (Resultado == -1) {
								return S;
							} else {
								S = S.Hijos[Resultado];
							}
						} else {
							return S.Padre;
						}
						Resultado = S.Pertenece(ref Poliedro, CajaSUR);
					} while (Resultado != -2 && Resultado != -1);

					return S;
				}
			} else {
				throw new ExcepcionGeometrica3D("OCTREE (PERTENECE): El poliedro especificado no pertenece al espacio dominado por el quadtree." + Constants.vbNewLine + "Poliedro=" + Poliedro.ToString() + Constants.vbNewLine + "Espacio=" + Octree.Espacio.ToString());
			}
		}
Example #3
0
		public static SectorOctree Sector(Octree Octree, Recta3D Recta)
		{
			int Resultado = Octree.SectorRaiz.Pertenece(ref Recta);
			SectorOctree S = Octree.SectorRaiz;

			if (Resultado != -2) {
				if (Resultado == -1) {
					return S;
				} else {
					while (Resultado != -2 && Resultado != -1) {
						Resultado = S.Pertenece(ref Recta);
						if (Resultado != -2) {
							if (Resultado == -1) {
								return S;
							} else {
								S = S.Hijos[Resultado];
							}
						} else {
							return S.Padre;
						}
					}

					return S;
				}
			} else {
				throw new ExcepcionGeometrica3D("OCTREE (PERTENECE): La recta especificada no pertenece al espacio dominado por el quadtree." + Constants.vbNewLine + "Punto=" + Recta.ToString() + Constants.vbNewLine + "Espacio=" + Octree.Espacio.ToString());
			}
		}