private void NormalizeColorsList()
        {
            Vector3 defaultColor = new Vector3(1.0f, 1.0f, 0.0f);

            for (int i = VerticesColors.Count; i < LocalVertices.Count; i++)
            {
                VerticesColors.Add(defaultColor);
            }
        }
 protected override bool ImportStandtradShapeData()
 {
     LocalVertices.Add(new Vector3(-0.5f, -0.5f, 0.0f));
     LocalVertices.Add(new Vector3(0.5f, -0.5f, 0.0f));
     LocalVertices.Add(new Vector3(0.0f, 0.5f, 0.0f));
     VerticesColors.Add(new Vector3(1.0f, 0.0f, 0.0f));
     VerticesColors.Add(new Vector3(0.0f, 1.0f, 0.0f));
     VerticesColors.Add(new Vector3(0.0f, 0.0f, 1.0f));
     return(base.ImportStandtradShapeData());
 }
        /// <inheritdoc />
        protected override void Initialize()
        {
            base.Initialize();

            Successors.Clear();
            VerticesColors.Clear();
            foreach (TVertex vertex in VisitedGraph.Vertices)
            {
                VerticesColors.Add(vertex, GraphColor.White);
                OnInitializeVertex(vertex);
            }
        }
        protected override bool ImportStandtradShapeData()
        {
            LocalVertices.Add(new Vector3(0.5f, 0.5f, 0.0f));    // Top Right
            LocalVertices.Add(new Vector3(0.5f, -0.5f, 0.0f));   // Bottom Right
            LocalVertices.Add(new Vector3(-0.5f, -0.5f, 0.0f));  // Bottom Left
            LocalVertices.Add(new Vector3(-0.5f, 0.5f, 0.0f));   // Top Left


            VerticesColors.Add(new Vector3(1.0f, 0.0f, 0.0f));
            VerticesColors.Add(new Vector3(0.0f, 1.0f, 0.0f));
            VerticesColors.Add(new Vector3(0.0f, 0.0f, 1.0f));
            return(base.ImportStandtradShapeData());
        }
        /// <inheritdoc />
        protected override void Initialize()
        {
            base.Initialize();

            // Initialize colors and distances
            double initialDistance = DistanceRelaxer.InitialDistance;

            foreach (TVertex vertex in VisitedGraph.Vertices)
            {
                VerticesColors.Add(vertex, GraphColor.White);
                Distances.Add(vertex, initialDistance);
                OnVertexInitialized(vertex);
            }
        }
Beispiel #6
0
        /// <inheritdoc />
        protected override void Initialize()
        {
            base.Initialize();

            // Initialize colors and distances
            double initialDistance = DistanceRelaxer.InitialDistance;

            foreach (TVertex vertex in VisitedGraph.Vertices)
            {
                VerticesColors.Add(vertex, GraphColor.White);
                SetVertexDistance(vertex, initialDistance);
            }

            _vertexQueue = new FibonacciQueue <TVertex, double>(DistancesIndexGetter());
        }
Beispiel #7
0
        /// <inheritdoc />
        protected override void Initialize()
        {
            base.Initialize();

            VerticesColors.Clear();
            _costs = new Dictionary <TVertex, double>(VisitedGraph.VertexCount);

            // Initialize colors and distances
            double initialDistance = DistanceRelaxer.InitialDistance;

            foreach (TVertex vertex in VisitedGraph.Vertices)
            {
                VerticesColors.Add(vertex, GraphColor.White);
                SetVertexDistance(vertex, initialDistance);
                _costs.Add(vertex, initialDistance);
            }

            _vertexQueue = new FibonacciQueue <TVertex, double>(_costs, DistanceRelaxer.Compare);
        }