Example #1
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // Declare a variable for the input String
            Topologic.Vertex vertex = null;

            // Use the DA object to retrieve the data inside the first input parameter.
            // If the retieval fails (for example if there is no data) we need to abort.
            if (!DA.GetData(0, ref vertex))
            {
                return;
            }

            // If the retrieved data is Nothing, we need to abort.
            // We're also going to abort on a zero-length String.
            if (vertex == null)
            {
                return;
            }
            //if (data.Length == 0) { return; }

            // Convert the String to a character array.
            //char[] chars = data.ToCharArray();

            List <double> coordinates = vertex.Coordinates;

            // Use the DA object to assign a new String to the first output parameter.
            DA.SetData(0, coordinates[0]);
            DA.SetData(1, coordinates[1]);
            DA.SetData(2, coordinates[2]);
        }
Example #2
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs Not store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // Declare a variable for the input String
            Topologic.Cell cell      = null;
            double         tolerance = 0.0001;

            // Use the DA object to retrieve the data inside the first input parameter.
            // If the retieval fails (for example if there is no data) we need to abort.
            if (!DA.GetData(0, ref cell))
            {
                return;
            }
            if (!DA.GetData(1, ref tolerance))
            {
                return;
            }

            // If the retrieved data is Nothing, we need to abort.
            // We're also going to abort on a zero-length String.
            if (cell == null)
            {
                return;
            }
            //if (data.Length == 0) { return; }

            // Convert the String to a character array.
            //char[] chars = data.ToCharArray();


            Topologic.Vertex vertex = Topologic.Utilities.CellUtility.InternalVertex(cell, tolerance);

            // Use the DA object to assign a new String to the first output parameter.
            DA.SetData(0, vertex);
        }
Example #3
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // Declare a variable for the input String
            Topologic.Edge edge = null;

            // Use the DA object to retrieve the data inside the first input parameter.
            // If the retieval fails (for example if there is no data) we need to abort.
            if (!DA.GetData(0, ref edge))
            {
                return;
            }

            // If the retrieved data is Nothing, we need to abort.
            // We're also going to abort on a zero-length String.
            if (edge == null)
            {
                return;
            }
            //if (data.Length == 0) { return; }

            // Convert the String to a character array.
            //char[] chars = data.ToCharArray();


            Topologic.Vertex vertex = edge.StartVertex;

            // Use the DA object to assign a new String to the first output parameter.
            DA.SetData(0, vertex);
        }
Example #4
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // Declare a variable for the input String
            Topologic.Topology topology = null;
            Topologic.Vertex   origin   = null;
            double             xVector  = 0.0;
            double             yVector  = 0.0;
            double             zVector  = 0.0;
            double             degree   = 0.0;

            // Use the DA object to retrieve the data inside the first input parameter.
            // If the retieval fails (for example if there is no data) we need to abort.
            if (!DA.GetData(0, ref topology))
            {
                return;
            }
            if (!DA.GetData(1, ref origin))
            {
                return;
            }
            if (!DA.GetData(2, ref xVector))
            {
                return;
            }
            if (!DA.GetData(3, ref yVector))
            {
                return;
            }
            if (!DA.GetData(4, ref zVector))
            {
                return;
            }
            if (!DA.GetData(5, ref degree))
            {
                return;
            }

            // If the retrieved data is Nothing, we need to abort.
            // We're also going to abort on a zero-length String.
            if (topology == null)
            {
                return;
            }
            if (origin == null)
            {
                return;
            }
            //if (endVertex == null) { return; }
            //if (data.Length == 0) { return; }

            // Convert the String to a character array.
            //char[] chars = data.ToCharArray();


            Topologic.Topology rotatedTopology = Topologic.Utilities.TopologyUtility.Rotate(topology, origin, xVector, yVector, zVector, degree);

            // Use the DA object to assign a new String to the first output parameter.
            DA.SetData(0, rotatedTopology);
        }
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // Declare a variable for the input String
            Topologic.Graph  graph     = null;
            Topologic.Vertex vertex1   = null;
            Topologic.Vertex vertex2   = null;
            double           tolerance = 0.0;

            // Use the DA object to retrieve the data inside the first input parameter.
            // If the retieval fails (for example if there is no data) we need to abort.
            if (!DA.GetData(0, ref graph))
            {
                return;
            }
            if (!DA.GetData(1, ref vertex1))
            {
                return;
            }
            if (!DA.GetData(2, ref vertex2))
            {
                return;
            }
            if (!DA.GetData(3, ref tolerance))
            {
                return;
            }

            // If the retrieved data is Nothing, we need to abort.
            // We're also going to abort on a zero-length String.
            if (graph == null)
            {
                return;
            }
            if (vertex1 == null)
            {
                return;
            }
            if (vertex2 == null)
            {
                return;
            }
            //if (data.Length == 0) { return; }

            // Convert the String to a character array.
            //char[] chars = data.ToCharArray();


            Topologic.Graph newGraph = graph.Connect(vertex1, vertex2, tolerance);

            // Use the DA object to assign a new String to the first output parameter.
            DA.SetData(0, newGraph);
        }
Example #6
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // Declare a variable for the input String
            Topologic.Graph  graph       = null;
            Topologic.Vertex startVertex = null;
            Topologic.Vertex endVertex   = null;
            int timeLimitInSeconds       = 0;

            // Use the DA object to retrieve the data inside the first input parameter.
            // If the retieval fails (for example if there is no data) we need to abort.
            if (!DA.GetData(0, ref graph))
            {
                return;
            }
            if (!DA.GetData(1, ref startVertex))
            {
                return;
            }
            if (!DA.GetData(2, ref endVertex))
            {
                return;
            }
            if (!DA.GetData(3, ref timeLimitInSeconds))
            {
                return;
            }

            // If the retrieved data is Nothing, we need to abort.
            // We're also going to abort on a zero-length String.
            if (graph == null)
            {
                return;
            }
            if (startVertex == null)
            {
                return;
            }
            if (endVertex == null)
            {
                return;
            }
            //if (data.Length == 0) { return; }

            // Convert the String to a character array.
            //char[] chars = data.ToCharArray();


            List <Topologic.Wire> paths = graph.AllPaths(startVertex, endVertex, timeLimitInSeconds);

            // Use the DA object to assign a new String to the first output parameter.
            DA.SetDataList(0, paths);
        }
Example #7
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // Declare a variable for the input String
            Topologic.Vertex   vertex        = null;
            Topologic.Topology otherTopology = null;

            // Use the DA object to retrieve the data inside the first input parameter.
            // If the retieval fails (for example if there is no data) we need to abort.
            if (!DA.GetData(0, ref vertex))
            {
                return;
            }
            if (!DA.GetData(1, ref otherTopology))
            {
                return;
            }

            // If the retrieved data is Nothing, we need to abort.
            // We're also going to abort on a zero-length String.
            if (vertex == null)
            {
                return;
            }
            if (otherTopology == null)
            {
                return;
            }
            //if (endVertex == null) { return; }
            //if (data.Length == 0) { return; }

            // Convert the String to a character array.
            //char[] chars = data.ToCharArray();


            double distance = Topologic.Utilities.VertexUtility.Distance(vertex, otherTopology);

            // Use the DA object to assign a new String to the first output parameter.
            DA.SetData(0, distance);
        }
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs Not store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // Declare a variable for the input String
            Topologic.Face   face   = null;
            Topologic.Vertex vertex = null;

            // Use the DA object to retrieve the data inside the first input parameter.
            // If the retieval fails (for example if there is no data) we need to abort.
            if (!DA.GetData(0, ref face))
            {
                return;
            }
            if (!DA.GetData(1, ref vertex))
            {
                return;
            }

            // If the retrieved data is Nothing, we need to abort.
            // We're also going to abort on a zero-length String.
            if (face == null)
            {
                return;
            }
            if (vertex == null)
            {
                return;
            }
            //if (data.Length == 0) { return; }

            // Convert the String to a character array.
            //char[] chars = data.ToCharArray();


            IList <double> UV = (IList <double>)Topologic.Utilities.FaceUtility.ParametersAtVertex(face, vertex);

            // Use the DA object to assign a new String to the first output parameter.
            DA.SetData(0, UV[0]);
            DA.SetData(1, UV[1]);
        }
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            Topologic.Graph  graph  = null;
            Topologic.Vertex vertex = null;

            // Use the DA object to retrieve the data inside the first input parameter.
            // If the retieval fails (for example if there is no data) we need to abort.
            if (!DA.GetData(0, ref graph))
            {
                return;
            }
            if (!DA.GetData(1, ref vertex))
            {
                return;
            }

            // If the retrieved data is Nothing, we need to abort.
            // We're also going to abort on a zero-length String.
            if (graph == null)
            {
                return;
            }
            if (vertex == null)
            {
                return;
            }
            //if (data.Length == 0) { return; }

            // Convert the String to a character array.
            //char[] chars = data.ToCharArray();


            List <Topologic.Vertex> adjacentVertices = graph.AdjacentVertices(vertex);

            // Use the DA object to assign a new String to the first output parameter.
            DA.SetDataList(0, adjacentVertices);
        }
Example #10
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // Declare a variable for the input String
            double x = 0.0;
            double y = 0.0;
            double z = 0.0;

            // Use the DA object to retrieve the data inside the first input parameter.
            // If the retieval fails (for example if there is no data) we need to abort.
            if (!DA.GetData(0, ref x))
            {
                return;
            }
            if (!DA.GetData(1, ref y))
            {
                return;
            }
            if (!DA.GetData(2, ref z))
            {
                return;
            }

            // If the retrieved data is Nothing, we need to abort.
            // We're also going to abort on a zero-length String.
            //if (data == null) { return; }
            //if (data.Length == 0) { return; }

            // Convert the String to a character array.
            //char[] chars = data.ToCharArray();


            Topologic.Vertex vertex = Topologic.Vertex.ByCoordinates(x, y, z);

            // Use the DA object to assign a new String to the first output parameter.
            DA.SetData(0, vertex);
        }
Example #11
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // Declare a variable for the input String
            Topologic.Graph  graph       = null;
            Topologic.Vertex startVertex = null;
            Topologic.Vertex endVertex   = null;
            String           vertexKey   = null;
            String           edgeKey     = null;

            // Use the DA object to retrieve the data inside the first input parameter.
            // If the retieval fails (for example if there is no data) we need to abort.
            if (!DA.GetData(0, ref graph))
            {
                return;
            }
            if (!DA.GetData(1, ref startVertex))
            {
                return;
            }
            if (!DA.GetData(2, ref endVertex))
            {
                return;
            }
            if (!DA.GetData(3, ref vertexKey))
            {
                return;
            }
            if (!DA.GetData(4, ref edgeKey))
            {
                return;
            }

            // If the retrieved data is Nothing, we need to abort.
            // We're also going to abort on a zero-length String.
            if (graph == null)
            {
                return;
            }
            if (startVertex == null)
            {
                return;
            }
            if (endVertex == null)
            {
                return;
            }
            if (vertexKey == null)
            {
                return;
            }
            if (edgeKey == null)
            {
                return;
            }
            //if (data.Length == 0) { return; }

            // Convert the String to a character array.
            //char[] chars = data.ToCharArray();


            Topologic.Wire shortestPath = graph.ShortestPath(startVertex, endVertex, vertexKey, edgeKey);

            // Use the DA object to assign a new String to the first output parameter.
            DA.SetData(0, shortestPath);
        }