Esempio n. 1
0
        /// <summary>
        /// Initialize the Helix with these values. These values should be attached before the
        /// visualization starts. Deleting them and attaching them does not make any effect on helix.
        /// So they are initialized before the process starts.
        /// </summary>
        private void InitializeHelix()
        {
            if (Model3DDictionary == null)
            {
                throw new Exception("Helix could not be initialized.");
            }

            directionalLight = new DirectionalLight3D
            {
                Color     = directionalLightColor,
                Direction = directionalLightDirection,
                Name      = DefaultLightName
            };

            if (!Model3DDictionary.ContainsKey(DefaultLightName))
            {
                Model3DDictionary.Add(DefaultLightName, directionalLight);
            }

            var gridModel3D = new DynamoLineGeometryModel3D
            {
                Geometry         = Grid,
                Transform        = Model1Transform,
                Color            = Color.White,
                Thickness        = 0.3,
                IsHitTestVisible = false,
                Name             = DefaultGridName
            };

            if (!Model3DDictionary.ContainsKey(DefaultGridName))
            {
                Model3DDictionary.Add(DefaultGridName, gridModel3D);
            }

            var axesModel3D = new DynamoLineGeometryModel3D
            {
                Geometry         = Axes,
                Transform        = Model1Transform,
                Color            = Color.White,
                Thickness        = 0.3,
                IsHitTestVisible = false,
                Name             = DefaultAxesName
            };

            if (!Model3DDictionary.ContainsKey(DefaultAxesName))
            {
                Model3DDictionary.Add(DefaultAxesName, axesModel3D);
            }

            AttachAllGeometryModel3DToRenderHost();
        }
Esempio n. 2
0
        private DynamoLineGeometryModel3D CreateLineGeometryModel3D(HelixRenderPackage rp, double thickness = 1.0)
        {
            var lineGeometry3D = new DynamoLineGeometryModel3D()
            {
                Geometry         = HelixRenderPackage.InitLineGeometry(),
                Transform        = Model1Transform,
                Color            = Color.White,
                Thickness        = thickness,
                IsHitTestVisible = false,
                IsSelected       = rp.IsSelected
            };

            return(lineGeometry3D);
        }