Пример #1
0
 /// <summary>
 /// Initialise an attributes object with the specified data
 /// </summary>
 /// <param name="sourceID"></param>
 /// <param name="layerName"></param>
 public GeometryAttributes(string sourceID, string layerName = null, DisplayBrush brush = null, double thickness = 1.0)
 {
     SourceID  = sourceID;
     LayerName = layerName;
     Brush     = brush;
     Weight    = thickness;
 }
Пример #2
0
        /// <summary>
        /// Convert a Nucleus DisplayBrush to a Rhino DisplayMaterial
        /// </summary>
        /// <param name="brush"></param>
        /// <returns></returns>
        public static DisplayMaterial Convert(DisplayBrush brush)
        {
            DisplayMaterial result = new DisplayMaterial();

            result.Diffuse      = Convert(brush.BaseColour);
            result.Emission     = Convert(brush.BaseColour);
            result.Transparency = 1.0 - brush.BaseColour.A / 255.0;
            return(result);
        }
Пример #3
0
 /// <summary>
 /// Convert a Nucleus brush to a WPF one
 /// </summary>
 /// <param name="brush">The brush to convert</param>
 /// <param name="alphaLimit">Optional.  The maximum value to which to limit the alpha channel of the colour.
 /// Use this to specify that the colour should be displayed as semitransparent even if the original to be converted
 /// was not.
 /// <returns></returns>
 public static Media.Brush Convert(DisplayBrush brush, byte alphaLimit = 255)
 {
     if (brush is ColourBrush)
     {
         return(Convert((ColourBrush)brush, alphaLimit));
     }
     else
     {
         return(null);
     }
 }
Пример #4
0
 /// <summary>
 /// Brush constructor.  Initialises a new GeometryAttributes object with the specified display brush.
 /// </summary>
 /// <param name="brush"></param>
 public GeometryAttributes(DisplayBrush brush, double thickness = 1.0)
 {
     Brush  = brush;
     Weight = thickness;
 }
Пример #5
0
 /// <summary>
 /// Name, brush constructor
 /// </summary>
 /// <param name="name">The name of the layer</param>
 /// <param name="brush">The default display brush of this layer</param>
 public GeometryLayer(string name, DisplayBrush brush) : this(name)
 {
     Brush = brush;
 }