public override void SetUp( Hisui.Graphics.DocumentViews docviews ) { _view.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; base.SetUp( docviews ); this.Controls.Add( _view ); this.AddView( _view ); }
protected override bool Execute( object target, Hisui.Ctrl.IContext con ) { var filter = string.Format( "{0}|{1}|All files (*.*)|*.*", _importer.MakeCaptionString(), _importer.MakeFileFilterString() ); var dialog = new OpenFileDialog { Filter = filter }; if ( dialog.ShowDialog() == DialogResult.OK ) { using ( var prg = Core.Progress.Start( "importing: " + dialog.FileName ) ) { prg.Step( 1.0 ); var dst = this.GetDestination( con ); _importer.Import( dst.Put( null ), dialog.FileName ); con.View.Fit(); } } return true; }
protected override bool Execute( object target, Hisui.Ctrl.IContext con ) { var filter = (_importer == null) ? GetFilterString() : GetFilterString( _importer ); var dialog = new OpenFileDialog { Filter = filter, Multiselect = true }; if ( dialog.ShowDialog() == DialogResult.OK ) { var imports = dialog.FileNames .Select( file => new { FileName = file, Importer = this.GetImporter( file ) } ) .Where( item => item.Importer != null ) .ToArray(); using ( var progress = SI.StartProgress( "importing" ) ) { foreach ( var item in imports ) { progress.Step( 1.0 / imports.Length ); this.Import( item.FileName, item.Importer, con ); SI.Increment(); } } } return true; }
/// <summary> /// Kinectのデータを描画する /// </summary> /// <param name="sc"></param> public void Draw( Hisui.Graphics.ISceneContext sc ) { //Kinect からデータ取得 if ( GetPoint() ) { //点群を描画 using ( var scope = sc.Push() ) { scope.Lighting = false; GL.glPointSize( PointSize ); GL.glBegin( GL.GL_POINTS ); for ( int i = 0; i < rgb.Length; i++ ) { GL.glColor3d( rgb[i].R, rgb[i].G, rgb[i].B ); GL.glVertex3d( depth[i].X, depth[i].Y, depth[i].Z ); } GL.glEnd(); } } //描画が終わる度に次の描画のリクエストを発行する Hisui.SI.View.Invalidate(); }
public override void SetUp( Hisui.Graphics.DocumentViews docviews ) { base.SetUp( docviews ); this.Controls.Add( _panel ); _panel.TopLeftPanel.Controls.Add( _views[0] ); _panel.TopRightPanel.Controls.Add( _views[1] ); _panel.BottomLeftPanel.Controls.Add( _views[2] ); _panel.BottomRightPanel.Controls.Add( _views[3] ); #if true foreach ( Graphics.GLViewControl view in _views ) { this.AddView( view ); } #else this.AddView( _views[0] ); this.AddView( _views[1], new int[] { 1 } ); this.AddView( _views[2], new int[] { 2 } ); this.AddView( _views[3], new int[] { 3 } ); #endif }
static Hisui.Geom.Point2d GetIntersection( Hisui.Geom.CodSys3d plane, Hisui.Geom.Line3d line ) { var t = GeomUT.Dot( plane.o - line.Origin, plane.n ) / GeomUT.Dot( line.Direction, plane.n ); var r = line.Position( t ) - plane.o; return GeomUT.P( GeomUT.Dot( plane.u, r ), GeomUT.Dot( plane.v, r ) ); }
public void PreDraw( Hisui.Graphics.ISceneContext sc ) { if ( this.Direction == ClipDirections.None ) return; var sphere = _docviews.WorldDocumentScene.BoundingSphere; var range = new Hisui.Geom.Range( -sphere.Radius, sphere.Radius ); var codsys = Geom.CodSys3d.Unit; switch ( this.Direction ) { case ClipDirections.View: codsys.r = sc.Camera.ViewingPos.r; codsys.SetRotation( codsys.v, codsys.u ); break; case ClipDirections.PlusX: codsys.SetRotation( Geom.Vector3d.Ey, Geom.Vector3d.Ez ); break; case ClipDirections.PlusY: codsys.SetRotation( Geom.Vector3d.Ez, Geom.Vector3d.Ex ); break; case ClipDirections.PlusZ: codsys.SetRotation( Geom.Vector3d.Ex, Geom.Vector3d.Ey ); break; case ClipDirections.MinusX: codsys.SetRotation( Geom.Vector3d.Ez, Geom.Vector3d.Ey ); break; case ClipDirections.MinusY: codsys.SetRotation( Geom.Vector3d.Ex, Geom.Vector3d.Ez ); break; case ClipDirections.MinusZ: codsys.SetRotation( Geom.Vector3d.Ey, Geom.Vector3d.Ex ); break; } codsys.o = sphere.Center + range.ParamToValue( this.Position ) * codsys.n; _clip.CodSys = codsys; _clip.PreDraw( sc ); }
public void PostDraw( Hisui.Graphics.ISceneContext sc ) { if ( this.Direction == ClipDirections.None ) return; _clip.PostDraw( sc ); }
public override Hisui.Ctrl.CommandOption QueryOption( object target, Hisui.Ctrl.IContext con ) { return new Ctrl.CommandOption { QueryRunnable = !Core.Progress.IsBusy }; }
public void Run( object target, Hisui.Ctrl.IContext context ) { new ErrorListDialog().ShowDialog(); }