Пример #1
0
 /// <summary>
 /// construct ILAxis object. This contructor is not to be called directly.
 /// </summary>
 /// <param name="name">type of the axis: XAxis,YAxis,ZAxis</param>
 /// <param name="clippingView">Clipping data to be registered into the axis.</param>
 /// <param name="layoutData">additional layout data, does currently only contain the camera [depricated]</param>
 /// <param name="panel">panel hosting the scene</param>
 /// <remarks>ILAxis objects are created GL-device dependend by use of a device dependend ILPanel instance's
 /// member ILPanel.CreateAxis(). This acts like a factory pattern. The specific axis derivate will be
 /// created by the derived ILPanel object (ILDXPanel or ILOGLPanel).</remarks>
 public ILAxis(AxisNames name, ILClippingData clippingView,
               ILLayoutData layoutData, ILPanel panel)
 {
     m_panel                 = panel;
     m_axisName              = name;
     m_labeledTicks          = new ILTickCollection(panel, m_axisName);
     m_layoutData            = layoutData;
     m_labelProvider         = null;
     m_labeledTicks.Changed += new AxisChangedEventHandler(m_labeledTicks_Changed);
     m_unLabeledTicks        = new List <UnlabeledTick>(10);
     m_grid                   = new ILLineProperties();
     m_grid.Style             = LineStyle.Dashed;
     m_grid.Changed          += new EventHandler(m_grid_Changed);
     m_clipping               = clippingView;
     m_axisType               = AxisType.Linear;
     m_nearLines              = new ILLineProperties();
     m_nearLines.Color        = Color.DarkBlue;
     m_nearLines.Width        = 1;
     m_nearLines.Antialiasing = true;
     m_nearLines.Changed     += new EventHandler(m_grid_Changed);
     m_farLines               = new ILLineProperties();
     m_farLines.Color         = Color.DarkBlue;
     m_farLines.Width         = 1;
     m_farLines.Antialiasing  = true;
     m_farLines.Changed      += new EventHandler(m_grid_Changed);
     m_label                  = new ILLabel(panel);
     m_label.Changed         += new EventHandler(m_label_Changed);
     m_clipping.Changed      += new ILClippingDataChangedEvent(m_clipping_Changed);
     m_invalidated            = true;
 }
Пример #2
0
 /// <summary>
 /// create a new instance of this class based on another instance
 /// </summary>
 /// <param name="props">properties to be copied</param>
 public ILLineProperties(ILLineProperties props)
 {
     m_lineStyle        = props.Style;
     m_foreColor        = props.Color;
     m_lineWidth        = props.Width;
     m_linePattern      = props.Pattern;
     m_linePatternScale = props.PatternScale;
     m_visible          = true;
     m_antialiasing     = props.m_antialiasing;
 }
Пример #3
0
 public void CopyFrom(ILLineProperties props)
 {
     if (props != null)
     {
         this.Antialiasing = props.Antialiasing;
         this.Color        = props.Color;
         this.Pattern      = props.Pattern;
         this.PatternScale = props.PatternScale;
         this.Style        = props.Style;
         this.Visible      = props.Visible;
         this.Width        = props.Width;
     }
 }
Пример #4
0
         /// <summary>
         /// create new lit 3D box
         /// </summary>
         /// <param name="panel">panel hosting the scene</param>
         /// <param name="min">minimum coordinates defining the box' dimensions (x,y,z)</param>
         /// <param name="max">minimum coordinates defining the box' dimensions (x,y,z)</param>
         /// <param name="fillColor">overall color for the box</param>
         /// <param name="topColor">color used to color the top edges of the box</param>
         public ILLitBox3D(ILPanel panel, ILPoint3Df min, ILPoint3Df max, Color fillColor, Color topColor)
             : base(panel) {
             m_lineProperties = new ILLineProperties();
             m_lineProperties.Changed += new EventHandler(m_lineProperties_Changed);
             m_valLabel = new ILWorldLabel(panel);
             m_valLabel.Text = ""; // (max * 1000).Z.ToString("F3");

             ILPoint3Df mi = ILPoint3Df.Min(min, max);
             ILPoint3Df ma = ILPoint3Df.Max(min, max);
             m_valLabel.PositionMax = new ILPoint3Df(ma.X,mi.Y,ma.Z);
             m_valLabel.PositionMin = new ILPoint3Df(mi.X, ma.Y, ma.Z); ;

             m_topLabel = new ILShapeLabel(panel);
             m_topLabel.Color = Color.Blue;
             //m_topLabel.Font = new Font("Arial", 10, FontStyle.Bold);
             string tval = max.Z.ToString("F2");
             m_topLabel.Text =  String.Format("{0}",tval);
             m_topLabel.Anchor = new PointF(0.5f, 1); 

             m_topColor = topColor;

             #region setup quads
             m_quads = new ILLitQuad[6];

             // front
             ILLitQuad quad = new ILLitQuad(m_panel);
             quad.Vertices[0].Position = new ILPoint3Df(min.X, min.Y, min.Z);
             quad.Vertices[1].Position = new ILPoint3Df(min.X, min.Y, max.Z);
             quad.Vertices[2].Position = new ILPoint3Df(max.X, min.Y, max.Z);
             quad.Vertices[3].Position = new ILPoint3Df(max.X, min.Y, min.Z);
             m_quads[QuadIndices.front] = quad; 
             // right
             quad = new ILLitQuad(m_panel);
             quad.Vertices[0].Position = new ILPoint3Df(max.X, min.Y, min.Z);
             quad.Vertices[1].Position = new ILPoint3Df(max.X, min.Y, max.Z);
             quad.Vertices[2].Position = new ILPoint3Df(max.X, max.Y, max.Z);
             quad.Vertices[3].Position = new ILPoint3Df(max.X, max.Y, min.Z);
             m_quads[QuadIndices.right] = quad;
             // back
             quad = new ILLitQuad(m_panel);
             quad.Vertices[0].Position = new ILPoint3Df(max.X, max.Y, min.Z);
             quad.Vertices[1].Position = new ILPoint3Df(max.X, max.Y, max.Z);
             quad.Vertices[2].Position = new ILPoint3Df(min.X, max.Y, max.Z);
             quad.Vertices[3].Position = new ILPoint3Df(min.X, max.Y, min.Z);
             m_quads[QuadIndices.back] = quad;
             // left
             quad = new ILLitQuad(m_panel);
             quad.Vertices[0].Position = new ILPoint3Df(min.X, max.Y, min.Z);
             quad.Vertices[1].Position = new ILPoint3Df(min.X, max.Y, max.Z);
             quad.Vertices[2].Position = new ILPoint3Df(min.X, min.Y, max.Z);
             quad.Vertices[3].Position = new ILPoint3Df(min.X, min.Y, min.Z);
             m_quads[QuadIndices.left] = quad;
             // top
             quad = new ILLitQuad(m_panel); 
             quad.Vertices[0].Position = new ILPoint3Df(min.X, min.Y, max.Z);
             quad.Vertices[1].Position = new ILPoint3Df(max.X, min.Y, max.Z);
             quad.Vertices[2].Position = new ILPoint3Df(max.X, max.Y, max.Z);
             quad.Vertices[3].Position = new ILPoint3Df(min.X, max.Y, max.Z);
             m_quads[QuadIndices.top] = quad;
             // bottom
             quad = new ILLitQuad(m_panel);
             quad.Vertices[0].Position = new ILPoint3Df(min.X, min.Y, min.Z);
             quad.Vertices[1].Position = new ILPoint3Df(max.X, min.Y, min.Z);
             quad.Vertices[2].Position = new ILPoint3Df(max.X, max.Y, min.Z);
             quad.Vertices[3].Position = new ILPoint3Df(min.X, max.Y, min.Z);
             m_quads[QuadIndices.bottom] = quad;
             #endregion
             EventingSuspend();
             foreach (ILLitQuad s in m_quads) {
                 s.Label.Text = "";
                 s.Shading = ShadingStyles.Interpolate;
                 s.Opacity = m_opacity;
                 s.Border.Color = Color.Gray;
                 s.Border.Width = 1;
                 s.Border.Visible = true;
                 s.Border.Antialiasing = false; 
                 Add(s); 
             }
             EventingResume(); 
             m_fillColor = fillColor;
             updateColors();
         }
Пример #5
0
 /// <summary>
 /// create new lit sink
 /// </summary>
 /// <param name="max">lenght of the squared ground</param>
 /// <param name="panel">panel hosting the scene</param>
 /// <param name="resolution">horizontal and vertical resolution</param>
 public ILLitSink(ILPanel panel, float max, int resolution)
     : base(panel) {
     m_max = max; 
     m_res = resolution; 
     m_lowCut = -3; 
     m_gridProperties = new ILLineProperties(); 
     m_gridProperties.Color = Color.LightBlue; 
     m_gridProperties.Width = 1; 
     m_gridProperties.Antialiasing = false; 
     m_gridProperties.Style = LineStyle.Solid; 
     m_gridSpacing = 1.0f; 
     m_linesUpdateNeeded = false; 
     m_timer = new Timer(); 
     m_timer.Interval = int.MaxValue;
     m_timer.Tick += new EventHandler(m_timer_Tick);
     createShapes(); 
     Invalidate();
 }
Пример #6
0
 /// <summary>
 /// create a new instance of this class based on another instance
 /// </summary>
 /// <param name="props">properties to be copied</param>
 public ILLineProperties(ILLineProperties props) {
     m_lineStyle = props.Style; 
     m_foreColor = props.Color;
     m_lineWidth = props.Width; 
     m_linePattern = props.Pattern; 
     m_linePatternScale = props.PatternScale; 
     m_visible = true; 
     m_antialiasing = props.m_antialiasing;
 }
Пример #7
0
 public void CopyFrom(ILLineProperties props) {
     if (props != null) {
         this.Antialiasing = props.Antialiasing;
         this.Color = props.Color;
         this.Pattern = props.Pattern;
         this.PatternScale = props.PatternScale;
         this.Style = props.Style;
         this.Visible = props.Visible;
         this.Width = props.Width; 
     }
 }