📄 view.c
字号:
/****************************************************************/
/* COPYRIGHT NOTICE */
/* ---------------- */
/* All software in this listing remain the strict copyright */
/* of Ilija Kovacevic and cannot be copied or used in any way */
/* except by written permission of Ilija Kovacevic. */
/* */
/* Copyright (c) 1992 Ilija Kovacevic */
/* www.kov.com email ilija@kov.com */
/****************************************************************/
#include "dwgin.h"
PUBLIC AcadView *AcadView__create( void )
{
return( ( AcadView * )get_memory( sizeof( AcadView ) ) );
}
PUBLIC void AcadView__delete( AcadView *me )
{
free( ( char * )me );
}
PUBLIC void AcadView__read( AcadView *me )
{
INT16 unknown;
if ( debugger ) dprintf( "\nVIEW -----------------------------------------------------\n" );
get_UINT8( &me->flags );
get_array( &me->name,sizeof( me->name ) );
get_INT16( &unknown );
get_DOUBLE( &me->height );
get_DOUBLE( &me->center_x );
get_DOUBLE( &me->center_y );
get_DOUBLE( &me->width );
get_DOUBLE( &me->view_x );
get_DOUBLE( &me->view_y );
get_DOUBLE( &me->view_z );
get_INT16( &me->mode );
get_DOUBLE( &me->target_x );
get_DOUBLE( &me->target_y );
get_DOUBLE( &me->target_z );
get_DOUBLE( &me->lens_length );
get_DOUBLE( &me->twist_angle );
get_DOUBLE( &me->front_clipping_plane );
get_DOUBLE( &me->back_clipping_plane );
get_INT16( &me->viewmode );
}
PUBLIC void AcadView__dxfout( AcadView *me )
{
dxf_string( 0,"VIEW" );
dxf_string( 2,me->name );
dxf_INT16( 70,me->flags );
dxf_DOUBLE( 40,me->height );
dxf_DOUBLE( 10,me->center_x );
dxf_DOUBLE( 20,me->center_y );
dxf_DOUBLE( 41,me->width );
dxf_DOUBLE( 11,me->view_x );
dxf_DOUBLE( 21,me->view_y );
dxf_DOUBLE( 31,me->view_z );
dxf_DOUBLE( 12,me->target_x );
dxf_DOUBLE( 22,me->target_y );
dxf_DOUBLE( 32,me->target_z );
dxf_DOUBLE( 42,me->lens_length );
dxf_DOUBLE( 43,me->front_clipping_plane );
dxf_DOUBLE( 44,me->back_clipping_plane );
dxf_DOUBLE( 50,rad_to_degrees( me->twist_angle ) );
dxf_INT16( 71,me->viewmode );
}
PUBLIC void AcadView__dump_to_debug_file( AcadView *me )
{
dprintf( "VIEW\n" );
dprintf( "\tname [%s]\n",me->name );
dprintf( "\tflags %xH\n",me->flags );
dprintf( "\theight %lf\n",me->height );
dprintf( "\tcenter %lf,%lf\n",me->center_x,me->center_y );
dprintf( "\twidth %lf\n",me->width );
dprintf( "\tview %lf,%lf,%lf\n",me->view_x,me->view_y,me->view_z );
dprintf( "\ttarget %lf,%lf,%lf\n",me->target_x,me->target_y,me->target_z );
dprintf( "\tlens length %lf\n",me->lens_length );
dprintf( "\tfront clipping plane %lf\n",me->front_clipping_plane );
dprintf( "\tback clipping plane %lf\n",me->back_clipping_plane );
dprintf( "\ttwist angle %lf\n",rad_to_degrees( me->twist_angle ) );
dprintf( "\tviewmode %xH\n",me->viewmode );
}
PUBLIC void AcadView__write( AcadView *me )
{
INT16 unknown;
unknown = 0;
put_UINT8( me->flags );
put_array( me->name,sizeof( me->name ) );
put_INT16( unknown );
put_DOUBLE( me->height );
put_DOUBLE( me->center_x );
put_DOUBLE( me->center_y );
put_DOUBLE( me->width );
put_DOUBLE( me->view_x );
put_DOUBLE( me->view_y );
put_DOUBLE( me->view_z );
put_INT16( me->mode );
put_DOUBLE( me->target_x );
put_DOUBLE( me->target_y );
put_DOUBLE( me->target_z );
put_DOUBLE( me->lens_length );
put_DOUBLE( me->twist_angle );
put_DOUBLE( me->front_clipping_plane );
put_DOUBLE( me->back_clipping_plane );
put_INT16( me->viewmode );
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -