Mobile Communication Direct

水平方向または垂直方向の注記を作成、表示


サンプル

#include	<uf_drf.h>
#include	<uf_drf_errors.h>
#include	<uf_drf_types.h>

int	ThisProject(void){

	int	ret;

	//----------	水平方向または垂直方向の注記を作成	----------

	int	num_lines_text = 1;
	char	**text_string;
	double	origin_3d[3] = {10.0, 10.0, 0.0};
	int	orientation = 0;
	/*
	注記の方向付け。
	0 - 水平方向
	1 - 垂直方向
	*/

	tag_t	note_tag;

	text_string	= (char**)malloc(sizeof(char*));
	*text_string	= (char*)malloc(sizeof(char));

	sprintf(text_string[0], "test1");

	
	//水平方向または垂直方向の注記を作成
	ret = UF_DRF_create_note(num_lines_text, text_string, origin_3d, orientation, 
						&note_tag );
	if (ret != 0){uc1601("ERROR", 1); return -1;}


	//----------	既存の注釈の色と高さを設定	----------

	int	mpi_array[100];
	double	mpr_array[70];
	char	rad_symbol[27], dia_symbol[27];

	//既存の注釈から製図パラメータを呼び出し、チェックを行う
	ret = UF_DRF_ask_object_preferences(note_tag, 
		mpi_array, mpr_array, rad_symbol, dia_symbol);
	if (ret != 0){uc1601("ERROR", 1); return -1;}

	mpi_array[87]	= 6;		//Color
	mpr_array[44]	= 20.0;		//Hight


	//指定した注釈に要素設定を設定
	ret = UF_DRF_set_object_preferences
		(note_tag, mpi_array, mpr_array, rad_symbol, dia_symbol);
	if (ret != 0){uc1601("ERROR", 1); return -1;}

	orientation = 1;

	ret = UF_DRF_create_note(num_lines_text, text_string, origin_3d, orientation, 
						&note_tag );

	free(text_string);

	return 0;
}