📄 arc.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 AcadArc *AcadArc__create( void )
{
return( ( AcadArc * )get_memory( sizeof( AcadArc ) ) );
}
PUBLIC void AcadArc__delete( AcadArc *me )
{
free( ( char * )me );
}
PUBLIC int AcadArc__length( AcadArc *me )
{
return( me->common.size );
}
PUBLIC void AcadArc__read( AcadArc *me )
{
AcadEntity__read_elevation_etc( &me->common,true,true );
get_DOUBLE( &me->x );
get_DOUBLE( &me->y );
get_DOUBLE( &me->radius );
get_DOUBLE( &me->start_angle );
get_DOUBLE( &me->end_angle );
if ( ( __drawing->acad10 OR __drawing->acad11 ) AND me->common.pflags&0x1 ) AcadEntity__get_ucs_directions( &me->common );
}
PUBLIC void AcadArc__dump_to_debug_file( AcadArc *me )
{
dprintf( "ARC\n" );
dprintf( "\tat %lf,%lf,%lf radius %lf\n",me->x,me->y,me->common.elevation,me->radius );
dprintf( "\tstart angle %lf end angle %lf\n",me->start_angle,me->end_angle );
}
PUBLIC void AcadArc__dxfout( AcadArc *me )
{
dxf_string( 0,"ARC" );
AcadEntity__dxfout( &me->common );
dxf_DOUBLE( 10,me->x );
dxf_DOUBLE( 20,me->y );
if ( !__drawing->header->flatland ) dxf_DOUBLE( 30,me->common.elevation );
dxf_DOUBLE( 40,me->radius );
dxf_DOUBLE( 50,rad_to_degrees( me->start_angle ) );
dxf_DOUBLE( 51,rad_to_degrees ( me->end_angle ) );
AcadEntity__dxfout_ucs( &me->common );
}
PUBLIC void AcadArc__write( AcadArc *me )
{
int size;
put_UINT8( 8 ); /* LINE TYPE */
size = sizeof( DOUBLE )*5+1;
if ( me->common.ucs ) size += sizeof( DOUBLE )*3;
AcadEntity__write_elevation_etc( &me->common,false,true,size );
put_DOUBLE( me->x );
put_DOUBLE( me->y );
put_DOUBLE( me->radius );
put_DOUBLE( me->start_angle );
put_DOUBLE( me->end_angle );
if ( me->common.ucs ) AcadEntity__put_ucs_directions( &me->common );
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -