code
stringlengths 1
2.01M
| repo_name
stringlengths 3
62
| path
stringlengths 1
267
| language
stringclasses 231
values | license
stringclasses 13
values | size
int64 1
2.01M
|
|---|---|---|---|---|---|
<?php
/*Language Format:
Add a new file(.lang.php) with your module name at /phpcms/languages/
translation save at the array:$LANG
*/
//add field
$LANG['formguide'] = '表单向导';
$LANG['input_form_title'] = '请输入表单向导名称!';
$LANG['title_min_3_chars'] = '表单向导至少3个汉字以上';
$LANG['right'] = '输入正确!';
$LANG['title_cannot_empty'] = '表单向导名称不能为空';
$LANG['field_manage'] = '字段管理';
$LANG['add_field'] = '添加字段';
$LANG['manage_field'] = '表单向导字段管理';
$LANG['priview_modelfield'] = '预览';
$LANG['fieldname'] = '字段名';
$LANG['cnames'] = '别名';
$LANG['type'] = '类型';
$LANG['system'] = '系统';
$LANG['must_input'] = '必填';
$LANG['search'] = '搜索';
$LANG['listorder'] = '排序';
$LANG['contribute'] = '投稿';
$LANG['field_enabled'] = '<font color="red"> 启用</font>';
$LANG['field_disabled'] = '禁用';
$LANG['fieldname'] = '字段类型';
$LANG['between_1_to_20'] = '长度必须为1-20位';
$LANG['fieldname_was_wrong'] = '字段名称不正确';
$LANG['already_exist'] = '已经存在';
$LANG['connecting_please_wait'] = '正在连接...请稍等';
$LANG['select_fieldtype'] = '请选择字段类型';
$LANG['input_nickname'] = '请输入别名';
$LANG['nickname_empty'] = '字段别名不能为空';
$LANG['input_right'] = '输入正确';
$LANG['field_type'] = '字段类型';
$LANG['fieldname_tips'] = '只能由英文字母、数字和下划线组成,并且仅能字母开头,不以下划线结尾';
$LANG['field_nickname'] = '字段别名';
$LANG['nickname_tips'] = '例如:文章标题';
$LANG['field_tip'] = '字段提示';
$LANG['field_tips'] = '显示在字段别名下方作为表单输入提示';
$LANG['relation_parm'] = '相关参数';
$LANG['relation_parm_tips'] = '设置表单相关属性';
$LANG['form_attr'] = '表单附加属性';
$LANG['form_attr_tips'] = '可以通过此处加入javascript事件';
$LANG['form_css_name'] = '表单样式名';
$LANG['form_css_name_tips'] = '定义表单的CSS样式名';
$LANG['string_size'] = '字符长度取值范围';
$LANG['string_size_tips'] = '系统将在表单提交时检测数据长度范围是否符合要求,如果不想限制长度请留空';
$LANG['minlength'] = '最小值';
$LANG['maxlength'] = '最大值';
$LANG['data_preg'] = '数据校验正则';
$LANG['data_preg_tips'] = '系统将通过此正则校验表单提交的数据合法性,如果不想校验数据请留空';
$LANG['often_preg'] = '常用正则';
$LANG['figure'] = '数字';
$LANG['integer'] = '整数';
$LANG['letter'] = '字母';
$LANG['integer_letter'] = '数字+字母';
$LANG['hyperlink'] = '超级链接';
$LANG['mobile_number'] = '手机号码';
$LANG['tel_number'] = '电话号码';
$LANG['zip'] = '邮政编码';
$LANG['data_passed_msg'] = '数据校验未通过的提示信息';
$LANG['unique'] = '值唯一';
$LANG['as_search_field'] = '作为搜索条件';
$LANG['disabled_groups_field'] = '禁止设置字段值的会员组';
$LANG['edit_field'] = '修改字段';
$LANG['public_field_manage'] = '管理公共字段';
$LANG['fields'] = '字段';
$LANG['picutre_list'] = '图片列表';
$LANG['max_upload_num'] = '您最多可以同时上传';
$LANG['zhang'] = '张';
$LANG['attachment_upload'] = '附件上传';
$LANG['select_picture'] = '选择图片';
//add formguide
$LANG['select_stardate'] = '启用时间限制时,请选择开始时间';
$LANG['select_downdate'] = '启用时间限制时,请选择结束时间';
$LANG['select_style'] = '选择风格';
$LANG['name'] = '名称';
$LANG['tablename'] = '表名';
$LANG['introduction'] = '简介';
$LANG['time_limit'] = '时间限制';
$LANG['enable'] = '启用';
$LANG['unenable'] = '不启用';
$LANG['start_time'] = '开始时间';
$LANG['end_time'] = '结束时间';
$LANG['allowed_send_mail'] = '允许发送邮件';
$LANG['e-mail_address'] = '接受邮件的地址';
$LANG['multiple_with_commas'] = '多个地址请用逗号隔开';
$LANG['optional_style'] = '可选风格';
$LANG['template_selection'] = '模板选择';
$LANG['please_input_tallename'] = '请填写表名';
$LANG['standard'] = '以字母开头,字母或数字或下划线构成';
$LANG['tablename_no_empty'] = '表名不能为空';
$LANG['edit_formguide'] = '编辑表单';
$LANG['public'] = '公共';
$LANG['stat_num'] = '统计数';
$LANG['thumb_shi'] = '图示';
$LANG['selects'] = '名称';
$LANG['values'] = '内容';
$LANG['tablename_existed'] = '数据表已存在';
$LANG['tablename_was_wrong'] = '表名输入错误';
//formguide list
$LANG['remove_all_selected'] = '删除选中';
$LANG['affirm_delete'] = '您确定要删除吗?';
$LANG['formguide_add'] = '添加表单向导';
$LANG['name_items'] = '名称(信息数)';
$LANG['create_time'] = '创建时间';
$LANG['call'] = '调用';
$LANG['visit_front'] = '访问前台';
$LANG['info_list'] = '信息列表';
$LANG['field_add'] = '添加字段';
$LANG['field_manage'] = '管理字段';
$LANG['preview'] = '预览';
$LANG['modify'] = '修改';
$LANG['stat'] = '统计';
$LANG['form_preview'] = '表单预览';
$LANG['return_list'] = '返回表单向导列表';
//formguide info
$LANG['username'] = '用户名';
$LANG['userip'] = '用户ip';
$LANG['times'] = '时间';
$LANG['operation'] = '操作';
$LANG['check'] = '查看';
$LANG['del'] = '删除';
$LANG['form_details'] = '表单详情';
$LANG['submit_info'] = '提交的信息';
$LANG['stat_formguide'] = '表单统计';
//setting
$LANG['formguide_setting'] = '表单向导模块配置';
$LANG['allows_more_ip'] = '允许同一IP多次提交';
$LANG['allowunreg'] = '允许游客提交表单';
$LANG['mailmessage'] = '发送邮件的内容';
$LANG['not_meet_the_conditions'] = '不符合要求';
$LANG['not_less_than'] = '不得少于';
$LANG['not_more_than'] = '不得多于';
$LANG['the_value_must_not_repeat'] = '的值不得重复!';
$LANG['interval'] = '两次提交间隔时间';
$LANG['minute'] = '分';
//index
$LANG['formguide_list'] = '表单向导列表';
$LANG['please_login_in'] = '请先登录网站!';
$LANG['form_no_exist'] = '此表单不存在或者已被删除!';
$LANG['form_expired'] = '表单已过期,感谢您的关注!';
$LANG['tips'] = '用户提交表单数据提醒';
$LANG['thanks'] = '感谢您的参与!';
$LANG['had_participate'] = '您已经参与过了!';
?>
|
108wo
|
phpcms/languages/zh-cn/formguide.lang.php
|
PHP
|
asf20
| 6,942
|
<?php
$LANG['email'] = '邮箱';
$LANG['or'] = '或者';
$LANG['nickname'] = '昵称';
$LANG['uid'] = '用户ID';
$LANG['regtime'] = '注册时间';
$LANG['lastlogintime'] = '最后登录';
$LANG['operation'] = '操作';
$LANG['password'] = '密码';
$LANG['cofirmpwd'] = '确认密码';
$LANG['realname'] = '真实姓名';
$LANG['enable_phpsso'] = '需开启PHPSSO';
$LANG['enable_register'] = '注册功能';
$LANG['nameerror'] = '用户名不能为空。';
$LANG['between_2_to_20'] = '应该为2-20位之间';
$LANG['between_2_to_20'] = '应该为2-20位之间';
$LANG['between_6_to_20'] = '应该为6-20位之间';
$LANG['between_1_to_20'] = '应该为1-20位之间';
$LANG['between_2_to_32'] = '应该为2-32位之间';
$LANG['already_exist'] = '已经存在';
$LANG['password_can_not_be_empty'] = '密码不能为空。';
$LANG['cannot_empty'] = '不能为空。';
$LANG['passwords_not_match'] = '两次密码不同。';
$LANG['old_password_incorrect'] = '原密码错误';
$LANG['old_password'] = '原密码';
$LANG['new_password'] = '新密码';
$LANG['re_input'] = '重复';
$LANG['passwords_match'] = '密码输入一致';
$LANG['newpassword'] = '新密码为';
$LANG['forgetpasswordmessage'] = '密码找回邮件内容';
$LANG['forgetpassword'] = '密码找回';
$LANG['no_phpcms_account'] = '您还没有注册PHPCMS会员?';
$LANG['immediately'] = '立即';
$LANG['use_passport'] = '使用外部通行证';
$LANG['other_passport'] = '其他通行证';
$LANG['other_passport_introduce'] = '通行证介绍';
$LANG['other_passport_info'] = 'PHPCMS支持使用第三方账号登录。';
$LANG['input'] = '请输入';
$LANG['checkcode'] = '验证码';
$LANG['validate'] = '验证';
$LANG['user'] = '会员';
$LANG['not_exists'] = '不存在';
$LANG['password_error'] = '密码错误';
$LANG['ait_1_hour'] = '请一小时后登录';
$LANG['connecting_please_wait'] = '请稍候...';
$LANG['not_change_the_password_please_leave_a_blank'] = '不修改密码请留空。';
$LANG['format_incorrect'] = '格式错误';
$LANG['format_right'] = '格式正确';
$LANG['email_already_exist'] = '邮箱已存在';
$LANG['email_config_empty'] = '邮箱设置为空,不能发送邮件,请联系管理员';
$LANG['email_error'] = '邮箱输入有误请重新输入';
$LANG['login_email'] = '登录邮箱';
$LANG['login_email_authentication'] = '请进行邮箱认证。';
$LANG['email_deny'] = '邮箱禁止注册';
$LANG['userid_banned_by_administrator'] = '您的会员组为禁止访问';
$LANG['need_emial_authentication'] = '需要邮箱认证';
$LANG['username_deny'] = '用户名禁止注册';
$LANG['regip'] = '注册ip';
$LANG['lastip'] = '上次登录ip';
$LANG['sure_delete'] = '您确定要删除吗?';
$LANG['delete'] = '删除';
$LANG['member'] = '会员';
$LANG['info'] = '信息';
$LANG['fill_in'] = '填写';
$LANG['basic_configuration'] = '基本信息';
$LANG['more_configuration'] = '详细信息';
$LANG['member_exist'] = '用户名已经存在';
$LANG['password_format_incorrect'] = '密码格式错误';
$LANG['username_format_incorrect'] = '用户名格式错误';
$LANG['email_format_incorrect'] = '邮箱格式错误';
$LANG['need_more_param'] = '参数不完整';
$LANG['verify_pass'] = '通过';
$LANG['sure_verify_pass'] = '确定审核通过?';
$LANG['amount'] = '金钱总数';
$LANG['buy_point'] = '购买积分';
$LANG['point'] = '积分点数';
$LANG['point_notice'] = ',积分点数将影响会员用户组';
$LANG['changegroup_notice'] = '非vip会员用户组与积分绑定,如只修改会员组请设置该会员为vip';
$LANG['lock'] = '锁定';
$LANG['user_is_lock'] = '用户已经被锁定';
$LANG['unlock'] = '解锁';
$LANG['move'] = '移动';
$LANG['deny_register'] = '禁止注册';
$LANG['read_protocol'] = '请阅读协议';
$LANG['click_read_protocol'] = '点击阅读注册协议';
$LANG['agree_protocol_post'] = '同意注册协议,提交注册';
$LANG['already_have_account'] = '已经有了账号?<br />请直接登录';
$LANG['forget_password_notice'] = '提交后请在一小时内登录邮箱重置会员密码。';
$LANG['or'] = '或';
$LANG['remember'] = '记住';
$LANG['vip'] = 'vip会员';
$LANG['isvip'] = '是否为vip会员';
$LANG['plsease_select'] = '请选择';
$LANG['member_group'] = '会员组';
$LANG['ignore'] = '忽略';
$LANG['reject'] = '拒绝';
$LANG['modelinfo'] = '模型资料';
$LANG['sendemail'] = '发送邮件通知被审核用户';
$LANG['regreason'] = '注册原因';
$LANG['verify_status'] = '审核状态';
$LANG['verify'] = '审核';
$LANG['verify_message'] = '审核信息';
$LANG['reg_reject'] = '您申请注册的账号被拒绝';
$LANG['reg_ignore'] = '您申请注册的账号被忽略';
$LANG['reg_delete'] = '您申请注册的账号被删除';
$LANG['reg_pass'] = '您申请注册的账号已通过';
$LANG['verify_message'] = '审核信息';
$LANG['verify_message'] = '审核信息';
$LANG['please_wait_administrator_verify'] = '请等待管理员审核。';
$LANG['register_verify_message'] = '邮件认证内容';
$LANG['need_verify'] = '未审核';
$LANG['pass_verify'] = '通过审核';
$LANG['nerver_pass'] = '重名无法通过';
$LANG['member_group_name'] = '会员组名称';
$LANG['member_group_access'] = '允许访问';
$LANG['member_group_search'] = '允许搜索';
$LANG['member_group_publish'] = '允许投稿';
$LANG['publish_deny'] = '禁止投稿';
$LANG['member_group_upgrade'] = '允许自助升级';
$LANG['member_group_sendmessage'] = '允许发短消息';
$LANG['member_group_publish_verify'] = '投稿不需审核';
$LANG['member_group_dayprice'] = '包日';
$LANG['member_group_monthprice'] = '包月';
$LANG['member_group_yearprice'] = '包年';
$LANG['member_group_maxmessagenum'] = '最大短消息数';
$LANG['allowpostnum'] = '日最大投稿数';
$LANG['zero_nolimit'] = '0为不限制';
$LANG['allowpostnum_deny'] = '今日投稿已超过限制数';
$LANG['member_group_username_color'] = '用户名颜色';
$LANG['not_less_than'] = '不得少于';
$LANG['not_more_than'] = '不得多于';
$LANG['member_group_icon'] = '用户组图标';
$LANG['member_group_deny'] = '是否禁用';
$LANG['member_group_creditrange'] = '积分小于';
$LANG['member_group_starnum'] = '星星数';
$LANG['member_group_upgradeprice'] = '升级价格';
$LANG['member_group_sentmessage'] = '允许发送短消息';
$LANG['member_group_sentmessage'] = '允许发送短消息';
$LANG['send_message'] = '发送短消息';
$LANG['member_group_description'] = '简洁描述';
$LANG['groupid'] = '用户组id';
$LANG['groupname'] = '用户组名';
$LANG['issystem'] = '系统组';
$LANG['starnum'] = '星星数';
$LANG['pointrange'] = '积分小于';
$LANG['allowvisit'] = '访问权限';
$LANG['allowpost'] = '投稿权限';
$LANG['allowsearch'] = '搜索权限';
$LANG['allowupgrade'] = '自助升级';
$LANG['allowpostverify'] = '投稿审核';
$LANG['allowsendmessage'] = '发短消息';
$LANG['message'] = '短消息';
$LANG['upgrade_price'] = '会员资费';
$LANG['price_y'] = '包年价格';
$LANG['price_m'] = '包月价格';
$LANG['price_d'] = '包天价格';
$LANG['need'] = '需要';
$LANG['upgrade_date'] = '购买时限';
$LANG['buy'] = '购买';
$LANG['year'] = '年';
$LANG['month'] = '月';
$LANG['day'] = '日';
$LANG['short_of_money'] = '余额不足';
$LANG['money_error'] = '格式错误';
$LANG['disabled'] = '是否禁用';
$LANG['description'] = '描述';
$LANG['view'] = '查看';
$LANG['membernum'] = '会员数';
$LANG['sort'] = '排序';
$LANG['between_2_to_8'] = '应该为2-8位之间';
$LANG['groupname_already_exist'] = '用户组名已存在';
$LANG['between_1_to_8_num'] = '应该为1-8位的数字';
$LANG['maxmessagenum'] = '短消息数';
$LANG['allow_register'] = '允许新会员注册';
$LANG['register_model'] = '注册选择模型';
$LANG['need_more_memberinfo'] = '请填写会员详细信息';
$LANG['register_email_auth'] = '新会员注册需要邮件验证';
$LANG['enablemailcheck_notice'] = '需填写邮箱配置,开启后会员注册审核功能无效';
$LANG['allow_memberlist'] = '允许前台浏览会员列表';
$LANG['register_verify'] = '新会员注册需要管理员审核';
$LANG['administrator'] = '管理员';
$LANG['member_verifycode'] = '会员注册启用验证码功能';
$LANG['click_change_validate'] = '点击更换验证码';
$LANG['upgrade_method'] = '会员升级付费方式';
$LANG['defualtpoint'] = '新会员默认点数';
$LANG['defualtamount'] = '新会员注册默认赠送资金';
$LANG['register_protocol'] = '会员注册协议';
$LANG['show_register_protocol'] = '是否显示注册协议';
$LANG['show_app_point'] = '是否启用应用间积分兑换';
$LANG['rmb_point_rate'] = '1元人民币购买积分数量';
$LANG['member_totalnum'] = '会员总数';
$LANG['register'] = '注册';
$LANG['register_notice'] = '更改会员模型会刷新页面,请首先选择会员模型。';
$LANG['success'] = '成功';
$LANG['agree'] = '同意';
$LANG['notice'] = '注意';
$LANG['member_verify_totalnum'] = '待审核会员数';
$LANG['nolimit'] = '无限制';
$LANG['member_search'] = '搜索会员';
$LANG['member_vip_totalnum'] = 'vip会员数';
$LANG['member_research'] = '重新搜索';
$LANG['normal'] = '正常';
$LANG['member_statistics'] = '会员统计';
$LANG['member_todaynum'] = '今日新增';
$LANG['normal'] = '正常';
$LANG['please_click'] = '请点击';
$LANG['reg_verify_email'] = '注册会员验证邮件';
$LANG['invalid_appid'] = '应用未通过盛大验证,请联系管理员';
$LANG['model_name'] = '模型名称';
$LANG['all_site'] = '所有站点';
$LANG['belong_to_site'] = '是否为公共模型';
$LANG['site_have_no_model'] = '站点无会员模型';
$LANG['model_import'] = '导入模型';
$LANG['member_model_add'] = '添加会员模型';
$LANG['member_model'] = '会员模型';
$LANG['model_description'] = '模型描述';
$LANG['table_name'] = '数据表名';
$LANG['tablename_already_exist'] = '数据表已存在';
$LANG['modelname_already_exist'] = '模型名已存在';
$LANG['deny_model'] = '是否禁用模型';
$LANG['from_model_name'] = '所在模型';
$LANG['to_model_name'] = '目标模型';
$LANG['model_member'] = '模型会员';
$LANG['login_success'] = '登录成功';
$LANG['login_failure'] = '登录失败';
$LANG['already_login'] = '已经登录';
$LANG['logout_success'] = '退出成功';
$LANG['login'] = '登录';
$LANG['password_empty'] = '请输入密码';
$LANG['username_empty'] = '请输入用户名';
$LANG['user_not_exist'] = '用户不存在';
$LANG['fieldname'] = '字段名';
$LANG['cnames'] = '别名';
$LANG['system'] = '系统';
$LANG['must_input'] = '必填';
$LANG['contribute'] = '投稿';
$LANG['member_modelfield_add'] = '添加模型字段';
$LANG['enable'] = '启用';
$LANG['disable'] = '禁用';
$LANG['modify'] = '修改';
$LANG['field'] = '字段';
$LANG['manage'] = '管理';
$LANG['export'] = '导出';
$LANG['need_more_point'] = '点数不足';
$LANG['need_more_amount'] = '金钱不足';
$LANG['credit_setting_error'] = '积分兑换设置错误';
$LANG['site_no_category'] = '该站点下暂无栏目,请选择其他站点';
$LANG['please_login'] = '您的会话已过期,请重新登录。';
$LANG['overdue'] = '已过期';
$LANG['overduedate'] = '过期时间';
$LANG['view_more_info'] = '查看详情';
$LANG['collect'] = '收藏夹';
$LANG['filedname_incorrect'] = '字段名称不正确';
$LANG['filedtype_need'] = '请选择字段类型';
$LANG['filedtype'] = '字段类型';
$LANG['input_correct'] = '输入正确';
$LANG['filed_nickname_need'] = '请输入别名';
$LANG['move_member_model_alert'] = '移动模型会员,将会把原有模型里的会员信息删除,不能修复。';
$LANG['move_member_model_index_alert'] = '1、请谨慎删除模型,当模型里存在会员时请使用“移动”功能将该模型里的会员移动到其他会员模型中。<br />2、移动模型会员,将会把原有模型里的会员信息删除,将不能修复。 ';
$LANG['create_new_model_can_empty'] = '(新建模型为空)';
$LANG['main_table_filed'] = '作为主表字段';
$LANG['filedname'] = '字段名';
$LANG['username_rule'] = '只能由英文字母、数字和下划线组成,并且仅能字母开头,不以下划线结尾';
$LANG['filed_nickname'] = '字段别名';
$LANG['exaple_title'] = '例如:文章标题';
$LANG['field_cue'] = '字段提示';
$LANG['nickname_alert'] = '显示在字段别名下方作为表单输入提示';
$LANG['correlation_param'] = '相关参数';
$LANG['correlation_attribute'] = '设置表单相关属性';
$LANG['extra_attribute'] = '表单附加属性';
$LANG['add_javascript'] = '可以通过此处加入javascript事件';
$LANG['form_css'] = '表单样式名';
$LANG['user_form_css'] = '定义表单的CSS样式名';
$LANG['string_len_range'] = '字符长度取值范围';
$LANG['post_alert'] = '系统将在表单提交时检测数据长度范围是否符合要求,如果不想限制长度请留空';
$LANG['min'] = '最小值:';
$LANG['max'] = '最大值:';
$LANG['value'] = '值';
$LANG['date_regular'] = '数据校验正则';
$LANG['validity_alert'] = '系统将通过此正则校验表单提交的数据合法性,如果不想校验数据请留空';
$LANG['common_regular'] = '常用正则';
$LANG['number'] = '数字';
$LANG['int'] = '整数';
$LANG['alphabet'] = '字母';
$LANG['http'] = '超级链接';
$LANG['mp'] = '手机号码';
$LANG['tel'] = '电话号码';
$LANG['postcode'] = '邮政编码';
$LANG['error_alert'] = '校验未通过的提示信息';
$LANG['form_error_alert'] = '当表单数据不满足正在校验时的系统提示信息';
$LANG['unique'] = '值唯一';
$LANG['can_empty'] = '是否为注册必填信息';
$LANG['search_condition'] = '作为搜索条件';
$LANG['isadd_condition'] = '是否在前台显示';
$LANG['isomnipotent_condition'] = '作为万能字段的附属字段';
$LANG['deny_set_field_group'] = '禁止设置字段值的会员组';
$LANG['deny_set_field_role'] = '禁止设置字段值的角色';
$LANG['points_less_than'] = '您的积分为<font color="red">{point}</font>点,发布投稿需要扣除<font color="red">{need_point}</font>点,您可以通过回复评论来获取积分';
$LANG['contributors_checked'] = '投稿成功,等待管理员审核';
$LANG['contributors_success'] = '内容已发布!感谢您的投稿!';
$LANG['has_been_verified'] = '投稿已经通过审核,不允许再次修改!';
$LANG['contribute_del_point'] = '投稿扣点';
$LANG['contribute_add_point'] = '投稿奖励';
$LANG['member_center'] = '会员中心';
$LANG['manage_center'] = '管理中心';
$LANG['account_manage'] = '账号管理';
$LANG['collection'] = '收藏';
$LANG['index'] = '首页';
$LANG['logout'] = '退出';
$LANG['hellow'] = '你好';
$LANG['add_child_menu'] = '添加子菜单';
$LANG['online_publish'] = '在线投稿';
$LANG['published_content'] = '已发布稿件';
$LANG['ssouser_can_not_modify_password'] = '外部通行证用户不允许修改邮箱密码';
$LANG['reject_content'] = '退稿';
$LANG['verify_content'] = '审核中';
$LANG['financial_management'] = '财务管理';
$LANG['online_charge'] = '在线充值';
$LANG['pay_log'] = '支付记录';
$LANG['cost_log'] = '消费记录';
$LANG['credit_change'] = '积分购买/兑换';
$LANG['input_box'] = '收件箱';
$LANG['output_box'] = '发件箱';
$LANG['system_message'] = '系统消息';
$LANG['deny_upgrade'] = '您所在的会员组禁止自主升级';
$LANG['memberinfo'] = '个人信息';
$LANG['account_remain'] = '账户余额';
$LANG['unit_yuan'] = '元';
$LANG['unit_point'] = '点';
$LANG['in_model'] = '所属模型';
$LANG['avatar'] = '头像';
$LANG['grow_info'] = '成长信息';
$LANG['with_star_must_input'] = '带*号的字段为必填资料';
$LANG['security_setting'] = '安全设置';
$LANG['click_login'] = '单击登录';
$LANG['sina_login'] = '用新浪账号登录';
$LANG['snda_login'] = '用盛大连接登录';
$LANG['qq_login'] = '用腾讯微博帐号登录';
$LANG['sina_login_notice'] = '使用新浪微博连接登录PHPCMS,将精彩内容分享到新浪微博。';
$LANG['qq_login_notice'] = '使用腾讯微博连接登录PHPCMS,将精彩内容分享到腾讯微博。';
$LANG['snda_login_notice'] = '使用用盛大连接登录PHPCMS,轻松使用盛大所有服务。';
$LANG['favorite_list'] = '收藏列表';
$LANG['adddate'] = '添加时间';
$LANG['buy_point'] = '购买积分';
$LANG['not_sufficient_funds'] = '您的余额不足';
$LANG['cost'] = '支出';
$LANG['can_change_point_num'] = '可兑换积分数';
$LANG['app_each'] = '应用间';
$LANG['please_select_cat'] = '请选择栏目';
$LANG['site_name'] = '站点名称';
$LANG['all_site'] = '所有站点';
$LANG['in_site_name'] = '所属站点';
$LANG['site_info'] = '站点描述';
$LANG['select'] = '选择';
$LANG['select_site'] = '选择站点';
$LANG['please_select_category'] = '请选择栏目';
$LANG['member_group_permission'] = '用户权限';
$LANG['no_permission'] = '没有权限';
$LANG['copyfrom_tips'] = '≡请选择≡';
$LANG['goback'] = '返回';
$LANG['allowattachment'] = '允许上传附件';
$LANG['attachment_upload'] = '附件上传';
$LANG['image_upload'] = '上传图片';
$LANG['remove'] = '移除';
$LANG['zhang'] = '张';
$LANG['max_upload_num'] = '您最多可以同时上传';
$LANG['picutre_list'] = '图片列表';
$LANG['select_picture'] = '选择图片';
$LANG['isurl'] = '是否为外部链接';
$LANG['url'] = '外部链接';
$LANG['info_top'] = '分类信息置顶';
$LANG['info_top_not_setting_toptime'] = '未选择置顶时间或置顶类型,请重试!';
$LANG['url'] = '外部链接';
?>
|
108wo
|
phpcms/languages/zh-cn/member.lang.php
|
PHP
|
asf20
| 18,041
|
<?php
$LANG['coment_class_php_1'] = '没有获取到正常的数据存储表。';
$LANG['coment_class_php_2'] = '数据存储表不存在,并在尝试创建数据存储表时出现错误,请联系管理员。';
$LANG['coment_class_php_3'] = '写入数据存储表时出错,请联系管理员。';
$LANG['coment_class_php_4'] = '自动创建数据存储表时出错,请联系管理员。';
$LANG['coment_class_php_5'] = '尝试添加评论数据时出错,请联系管理员。';
$LANG['coment_class_php_6'] = '评论没有找到。';
$LANG['coment_class_php_7'] = '评论发表成功,需要等待管理员审核,才会显示。';
$LANG['phpcms_friends'] = '网友';
$LANG['no_comment'] = '评论没有找到!';
$LANG['no_check_comments'] = '没有待审评论。';
$LANG['comments_module_configuration'] = '评论模块配置';
$LANG['comment_on_whether_to_allow_visitors'] = '是否允许游客评论';
$LANG['check_comment'] = '是否需要审核';
$LANG['whether_to_validate'] = '是否开启验证码';
$LANG['chez'] = '于';
$LANG['release'] = '发布';
$LANG['are_you_sure_you_want_to_delete'] = '您确定删除吗?';
$LANG['for_audit_several'] = '待审核数';
$LANG['pass'] = '通过';
$LANG['list'] = '列表';
$LANG['comments_on_the_survey'] = '评论概况';
$LANG['count'] = '计数';
$LANG['comments_id'] = '评论ID';
$LANG['site_id'] = '站点ID';
$LANG['comments_direction'] = '评论方向';
$LANG['jiushishuo'] = '无方向';
$LANG['tetragonal'] = '正方';
$LANG['cons'] = '反方';
$LANG['neutrality'] = '中立';
$LANG['sort'] = '排序';
$LANG['new'] = '最新';
$LANG['hot'] = '最热';
$LANG['support'] = '支持数';
$LANG['landing_users_to_comment'] = '登陆用户才可发表评论。';
$LANG['code_error'] = '验证码错误!';
$LANG['please_enter_code'] = '请输入验证码。';
$LANG['comment_bang'] = '评论排行榜';
$LANG['please_enter_content'] = '请输入内容。';
$LANG['dragonforce'] = '已经支持过了。';
$LANG['comment_point_del'] = '评论被删除,扣除积分。';
$LANG['comments_on_points_awards'] = '评论积分奖励';
$LANG['be_deleted_from_the_review_points'] = '评论被删除扣除积分';
$LANG['to_operate'] = ' 分,0为不操作。';
$LANG['canot_allow_comment'] = ' 该文不可评论。';
$LANG['please_chose_comment'] = '请选择评论,再进行删除操作。';
$LANG['comment_manage'] = '评论管理';
$LANG['choose_database'] = '请选择数据存储表';
$LANG['original'] = '原文';
$LANG['author'] = '发表人';
$LANG['no_comment'] = '暂无评论';
|
108wo
|
phpcms/languages/zh-cn/comment.lang.php
|
PHP
|
asf20
| 2,609
|
<?php
/*Language Format:
Add a new file(.lang.php) with your module name at /phpcms/languages/
translation save at the array:$LANG
*/
$LANG['announce'] = '公告';
$LANG['announce_manage'] = '公告管理';
$LANG['announce_list'] = '公告列表';
$LANG['announce_add'] = '添加公告';
$LANG['announce_title'] = '公告标题:';
$LANG['title_cannot_empty'] = '公告标题不能为空';
$LANG['announcements_cannot_be_empty'] = '公告内容不能为空';
$LANG['announcement_successful_added'] = '公告添加成功';
$LANG['announced_a'] = '公告修改成功';
$LANG['announce_passed'] = '公告批量通过完成!';
$LANG['announce_deleted'] = '公告批量删除完成!';
$LANG['startdate'] = '起始日期';
$LANG['enddate'] = '截止日期';
$LANG['announce_content'] = '公告内容:';
$LANG['announce_status'] = '公告状态:';
$LANG['edit_announce'] = '编辑公告';
$LANG['inputer'] = '录入者';
$LANG['check_annonuce'] = '审核公告';
$LANG['preview'] = '前台预览';
$LANG['index'] = '前台';
$LANG['cancel_all_selected'] = '取消批准选定的公告';
$LANG['pass_all_selected'] = '通过选定的公告';
$LANG['remove_all_selected'] = '删除选定的公告';
$LANG['overdue_announce'] = '过期公告';
$LANG['no_pass_announce'] = '未审核公告';
$LANG['no_exists'] = '此公告不存在或已删除!';
$LANG['affirm_delete'] = '您确定要删除吗?';
$LANG['input_announce_title'] = '请输入公告标题!';
$LANG['title_min_3_chars'] = '公告标题至少3个汉字以上';
$LANG['right'] = '输入正确!';
$LANG['server_no_data'] = '服务器没有返回数据,可能服务器忙,请重试';
$LANG['announce_exist'] = '该公告已存在';
$LANG['checking'] = '正进行合法性校验...';
$LANG['select_stardate'] = '请选择开始时间!';
$LANG['right_all'] = '正确!';
$LANG['select_downdate'] = '请选择下线时间!';
$LANG['select_style'] = '请选择风格!';
$LANG['available_style'] = '可用风格';
$LANG['lists'] = '列表';
$LANG['sitename'] = '站点';
?>
|
108wo
|
phpcms/languages/zh-cn/announce.lang.php
|
PHP
|
asf20
| 2,230
|
<?php
/*Language Format:
Add a new file(.lang.php) with your module name at /phpcms/languages/
translation save at the array:$LANG
*/
$LANG['member_manage'] = '管理会员';
$LANG['member_add'] = '添加会员';
$LANG['member_edit'] = '编辑会员';
$LANG['member_verify'] = '审核会员';
$LANG['member_group_manage'] = '会员组管理';
$LANG['member_model'] = '会员模型管理';
$LANG['member_group_add'] = '添加会员组';
$LANG['member_model_add'] = '添加会员模型';
$LANG['member_model_import'] = '导入会员模型';
$LANG['members'] = '用户';
$LANG['member_group_manage'] = '管理会员组';
$LANG['member_model_manage'] = '管理会员模型';
$LANG['manage_member'] = '会员管理';
$LANG['manage_member_group'] = '会员组管理';
$LANG['manage_member_model'] = '会员模型管理';
$LANG['menu_add'] = '添加菜单';
$LANG['site_edit'] = '编辑站点';
$LANG['site_del'] = '删除站点';
$LANG['add_site'] = '添加站点';
$LANG['release_point_add'] = '添加发布点';
$LANG['release_point_del'] = '删除发布点';
$LANG['release_point_edit'] = '编辑发布点';
$LANG['content_publish'] = '内容发布管理';
$LANG['content_manage'] = '管理内容';
$LANG['add_content'] = '添加内容';
$LANG['add_space'] = '添加版位';
$LANG['model_manage'] = '模型管理';
$LANG['add_model'] = '添加模型';
$LANG['vote'] = '投票';
$LANG['template_manager'] = '模板管理';
$LANG['template_style'] = '模板风格';
$LANG['userinterface'] = '界面';
$LANG['import_style'] = '导入风格';
$LANG['template_file'] = '模板文件';
$LANG['template_export'] = '导出风格';
$LANG['template_onoff'] = '开关风格';
$LANG['template_updatename'] = '更新风格中文名';
$LANG['member_lock'] = '锁定会员';
$LANG['member_unlock'] = '解锁会员';
$LANG['member_move'] = '移动会员';
$LANG['member_delete'] = '删除会员';
$LANG['memebr_verify'] = '审核会员';
$LANG['template_file_list'] = '模板文件列表';
$LANG['template_file_edit'] = '模板文件编辑';
$LANG['member_setting'] = '会员模块配置';
$LANG['basic_setting'] = '基本配置';
$LANG['title_setting'] = '组头衔管理';
$LANG['verify_pass'] = '已通过列表';
$LANG['ignore'] = '忽略列表';
$LANG['verify_deny'] = '拒绝列表';
$LANG['verify_ignore'] = '忽略列表';
$LANG['verify_delete'] = '已删除用户';
$LANG['verify_deny'] = '拒绝列表';
$LANG['never_pass'] = '无法通过';
$LANG['file_add_file'] = '新建模板文件';
$LANG['test'] = 'test';
$LANG['listorder'] = '排序';
$LANG['priv_setting'] = '权限管理';
$LANG['role_priv'] = '权限分配';
$LANG['edit_announce'] = '编辑公告';
$LANG['overdue'] = '过期公告';
$LANG['del_announce'] = '删除公告';
$LANG['edit_space'] = '编辑版位';
$LANG['del_space'] = '删除版位';
$LANG['poster_list'] = '广告列表';
$LANG['add_poster'] = '添加广告';
$LANG['edit_poster'] = '编辑广告';
$LANG['del_poster'] = '删除广告';
$LANG['poster_stat'] = '广告统计';
$LANG['poster_setting'] = '模块配置';
$LANG['attachment_manage'] = '附件管理';
$LANG['linkage'] = '联动菜单';
$LANG['special'] = '专题';
$LANG['template_editor'] = '模板编辑';
$LANG['template_visualization'] = '模板可视化';
$LANG['pc_tag_edit'] = '编辑PC标签';
$LANG['sync_release_point'] = '同步到发布点';
$LANG['release_manage'] = '发布管理';
$LANG['type_manage'] = '类别管理';
$LANG['add_type'] = '添加类别';
$LANG['failure_list'] = '失败列表';
$LANG['linkageadd'] = '添加菜单';
$LANG['correlative_setting'] = '相关设置';
$LANG['vote_setting'] = '投票配置';
$LANG['queue_del'] = '删除消息';
$LANG['admin_manage'] = '管理员管理';
$LANG['member_model_delete'] = '删除会员模型';
$LANG['member_model_edit'] = '修改会员模型';
$LANG['link'] = '友情链接';
$LANG['comment'] = '评论';
$LANG['workflow'] = '工作流';
$LANG['add_workflow'] = '添加工作流';
$LANG['comment_check'] = '评论审核';
$LANG['comment_list'] = '评论列表';
$LANG['member_modelfield_add'] = '添加会员模型字段';
$LANG['member_modelfield_edit'] = '编辑会员模型字段';
$LANG['member_modelfield_delete'] = '删除会员模型字段';
$LANG['member_modelfield_manage'] = '会员模型字段管理';
$LANG['sitemodel_import'] = '导入模型';
$LANG['pay'] = '在线充值';
$LANG['payments'] = '支付模块';
$LANG['paylist'] = '充值记录';
$LANG['add_content'] = '添加内容';
$LANG['modify_deposit'] = '充值入帐';
$LANG['check_content'] = '审核内容';
$LANG['dbsource'] = '数据源';
$LANG['data_call'] = '数据调用';
$LANG['external_data_sources'] = '外部数据源';
$LANG['create_content_html'] = '批量更新内容页';
$LANG['update_urls'] = '批量更新URL';
$LANG['fulltext_search'] = '全站搜索';
$LANG['manage_type'] = '管理分类';
$LANG['search_setting'] = '模块配置';
$LANG['createindex'] = '重建索引';
$LANG['add_search_type'] = '添加搜索分类';
$LANG['dbsource_add'] = '添加外部数据源';
$LANG['dbsource_edit'] = '编辑外部数据源';
$LANG['dbsource_del'] = '删除外部数据源';
$LANG['dbsource_data_add'] = '添加数据源调用';
$LANG['dbsource_data_edit'] = '编辑数据源调用';
$LANG['dbsource_data_del'] = '删除数据源调用';
$LANG['message'] = '短消息';
$LANG['database'] = '数据库管理';
$LANG['database_export'] = '数据库导出';
$LANG['database_import'] = '数据库导入';
$LANG['add_special'] = '添加专题';
$LANG['edit_special'] = '修改专题';
$LANG['special_list'] = '专题列表';
$LANG['special_elite'] = '推荐专题';
$LANG['delete_special'] = '删除专题';
$LANG['special_listorder'] = '专题排序';
$LANG['special_content_list'] = '专题信息管理';
$LANG['special_content_add'] = '信息添加';
$LANG['special_content_list'] = '信息列表';
$LANG['special_content_edit'] = '信息修改';
$LANG['special_content_delete'] = '信息删除';
$LANG['special_content_listorder'] = '信息排序';
$LANG['special_content_import'] = '信息导入';
$LANG['keyword_edit'] = '编辑关键字';
$LANG['keyword_delete'] = '已删除关键字列表';
$LANG['keyword_add'] = '添加关键字';
$LANG['badword_add'] = '添加敏感词';
$LANG['badword_edit'] = '修改敏感词';
$LANG['badword_delete'] = '删除敏感词';
$LANG['history_version'] = '历史版本';
$LANG['restore_version'] = '还原历史版本';
$LANG['del_history_version'] = '删除历史版本';
$LANG['block'] = '碎片管理';
$LANG['block_add'] = '添加碎片';
$LANG['setting'] = '配置';
$LANG['message_send'] = '群发短消息';
$LANG['my_message'] = '我的短消息';
$LANG['block_edit'] = '编辑碎片';
$LANG['block_del'] = '删除碎片';
$LANG['block_update'] = '更新碎片';
$LANG['block_restore'] = '碎片还原';
$LANG['history_del'] = '删除碎片历史';
$LANG['my_inbox'] = '我的收件箱';
$LANG['my_outbox'] = '我的发件箱';
$LANG['send_one'] = '发送消息';
$LANG['collection'] = '采集管理';
$LANG['collection_node'] = '采集管理';
$LANG['collection_content'] = '采集内容管理';
$LANG['node_add'] = '添加采集点';
$LANG['website_config'] = '网站配置';
$LANG['position_edit'] = '编辑推荐位';
$LANG['collection_node_edit'] = '编辑采集点';
$LANG['collection_node_delete'] = '删除采集点';
$LANG['collection_node_test'] = '测试采集点';
$LANG['collection_node_publish'] = '内容发布';
$LANG['collection_node_import'] = '导入采集点';
$LANG['collection_node_export'] = '导出采集点';
$LANG['collection_node_collection_content'] = '采集文章';
$LANG['googlesitemap'] = 'Baibu/Google地图';
$LANG['keylink'] = '关联链接';
$LANG['editpwd'] = '修改密码';
$LANG['admininfo'] = '个人信息';
$LANG['editpwd'] = '修改密码';
$LANG['panel'] = '我的面板';
$LANG['editinfo'] = '修改个人信息';
$LANG['add_keylink'] = '添加关联链接';
$LANG['content_settings'] = '内容相关设置';
$LANG['category_manage'] = '管理栏目';
$LANG['posid_manage'] = '推荐位管理';
$LANG['posid_add'] = '添加推荐位';
$LANG['extend'] = '扩展';
$LANG['extend_all'] = '扩展';
$LANG['keyword_manage'] = '关键字管理';
$LANG['badword_manage'] = '敏感词管理';
$LANG['menu_manage'] = '菜单管理';
$LANG['basic_config'] = '基本设置';
$LANG['safe_config'] = '安全配置';
$LANG['sso_config'] = 'PHPSSO配置';
$LANG['email_config'] = '邮箱配置';
$LANG['urlrule_manage'] = 'URL规则管理';
$LANG['ipbanned'] = 'IP禁止';
$LANG['module_manage'] = '模块管理';
$LANG['add_ipbanned'] = '添加IP禁止';
$LANG['downsites'] = '下载镜像管理';
$LANG['col_url_list'] = '采集网址';
$LANG['copy_node'] = '采集点复制';
$LANG['content_del'] = '删除文章';
$LANG['collection_content_import'] = '文章列表';
$LANG['import_program_add'] = '添加导入方案';
$LANG['import_program_del'] = '文章导入方案删除';
$LANG['import_content'] = '导入文章';
$LANG['add_page'] = '添加单网页';
$LANG['add_cat_link'] = '添加外部链接';
$LANG['add_category'] = '添加栏目';
$LANG['log'] = '后台操作日志';
$LANG['count_items'] = '重新统计栏目数据';
$LANG['cache_all'] = '更新全站缓存';
$LANG['create_list_html'] = '批量更新栏目页';
$LANG['create_html_quick'] = '生成操作';
$LANG['create_index'] = '生成首页';
$LANG['scan'] = '木马查杀';
$LANG['scan_report'] = '查杀报告';
$LANG['md5_creat'] = '生成md5';
$LANG['announce'] = '公告';
$LANG['mood'] = '新闻心情';
$LANG['mood_setting'] = '心情配置';
$LANG['phpsso'] = 'phpsso';
$LANG['edit_content'] = '修改内容';
$LANG['push_to_special'] = '推送';
$LANG['list_type'] = '分类管理';
$LANG['add_link'] = '添加友情链接';
$LANG['add_vote'] = '添加投票';
$LANG['edit_vote'] = '编辑投票';
$LANG['delete_vote'] = '删除投票';
$LANG['statistics_vote'] = '查看统计';
$LANG['statistics_userlist'] = '会员统计';
$LANG['edit_link'] = '编辑友情链接';
$LANG['delete_link'] = '删除友情链接';
$LANG['delete_message'] = '删除短消息';
$LANG['delete_ip'] = '删除IP禁止';
$LANG['delete_log'] = '删除日志';
$LANG['delete_keylink'] = '删除关联链接';
$LANG['edit_keylink'] = '编辑关联链接';
$LANG['operation_pass'] = '通过操作';
$LANG['operation_delete'] = '删除操作';
$LANG['operation_ignore'] = '忽略操作';
$LANG['operation_reject'] = '拒绝操作';
$LANG['member_edit'] = '编辑会员';
$LANG['member_group_edit'] = '编辑会员组';
$LANG['member_group_delete'] = '删除会员组';
$LANG['member_model_export'] = '导出会员模型';
$LANG['member_model_sort'] = '会员模型排序';
$LANG['member_model_move'] = '移动模型会员';
$LANG['settingsave'] = '配置保存';
$LANG['admin_edit'] = '编辑管理员';
$LANG['admin_delete'] = '删除管理员';
$LANG['card'] = '电子口令卡';
$LANG['creat_card'] = '绑定口令卡';
$LANG['remove_card'] = '解除口令卡';
$LANG['role_edit'] = '编辑角色';
$LANG['member_manage'] = '会员管理';
$LANG['role_delete'] = '删除角色';
$LANG['payment_add'] = '支付模块添加';
$LANG['payment_delete'] = '支付模块卸载';
$LANG['payment_edit'] = '支付模块编辑';
$LANG['spend_record'] = '消费记录';
$LANG['pay_stat'] = '在线充值统计';
$LANG['announce_add'] = '添加公告';
$LANG['check_announce'] = '审核公告';
$LANG['fields_manage'] = '字段管理';
$LANG['edit_model_content'] = '修改模型';
$LANG['disabled_model'] = '禁用模型';
$LANG['delete_model'] = '删除';
$LANG['export_model'] = '导出';
$LANG['delete'] = '删除';
$LANG['edit'] = '修改';
$LANG['add_urlrule'] = '添加规则';
$LANG['edit_urlrule'] = '修改';
$LANG['delete_urlrule'] = '删除';
$LANG['edit_menu'] = '修改';
$LANG['delete_menu'] = '删除';
$LANG['edit_workflow'] = '修改';
$LANG['delete_workflow'] = '删除';
$LANG['creat_html'] = '更新html';
$LANG['mood'] = '新闻心情';
$LANG['mood_setting'] = '心情配置';
$LANG['comment'] = '评论';
$LANG['comment_check'] = '评论审核';
$LANG['comment_list'] = '评论列表';
$LANG['link_setting'] = '模块配置';
$LANG['connect_config'] = 'connect';
$LANG['view_modelinfo'] = '查看模型信息';
$LANG['link'] = '友情链接';
$LANG['add_link'] = '添加友情链接';
$LANG['edit_link'] = '编辑友情链接';
$LANG['delete_link'] = '删除友情链接';
$LANG['add_type'] = '添加类别';
$LANG['list_type'] = '分类管理';
$LANG['position_item'] = '信息管理';
$LANG['message_group_manage'] = '群发短消息管理';
$LANG['create_special_list'] = '生成专题首页';
$LANG['create_poster_js'] = '重新生成js';
$LANG['database_toos'] = '数据库工具';
$LANG['cnzz'] = 'CNZZ统计';
$LANG['create_js'] = '更新JS';
$LANG['check_register'] = '审核申请';
$LANG['copyfrom_manage'] = '来源管理';
$LANG['view_memberlinfo'] = '查看会员信息';
$LANG['move_content'] = '移动内容';
$LANG['广告模板设置'] = '广告模板设置';
$LANG['poster_template'] = '广告模板设置';
$LANG['create_index'] = '生成首页';
$LANG['check_annonuce'] = '公告审核';
$LANG['add_othors'] = '同时发布到其他栏目';
$LANG['member_menu_manage'] = '前台菜单管理';
$LANG['member_menu_add'] = '添加菜单';
$LANG['member_menu_delete'] = '删除';
$LANG['member_menu_edit'] = '修改';
$LANG['member_index'] = '管理中心';
$LANG['member_init'] = '管理中心';
$LANG['account_manage'] = '账号管理';
$LANG['favorite'] = '收藏';
$LANG['wap'] = '手机门户';
$LANG['attachment_manager'] = '数据库模式';
$LANG['attachment_manager_dir'] = '目录模式';
$LANG['attachment_manager_db'] = '数据库模式';
$LANG['attachment_address_replace'] = '附件地址替换';
$LANG['attachment_address_update'] = '批量更新地址处理程序';
$LANG['delete_content'] = '删除内容';
$LANG['member_menu_manage'] = '前台菜单管理';
$LANG['member_menu_add'] = '添加菜单';
$LANG['member_menu_edit'] = '编辑菜单';
$LANG['member_menu_delete'] = '删除菜单';
$LANG['batch_show'] = '批量生成HTML';
$LANG['pay_delete'] = '删除支付记录';
$LANG['pay_cancel'] = '取消充值';
$LANG['discount'] = '充值改价';
$LANG['category_batch_edit'] = '批量编辑';
$LANG['formguide'] = '表单向导';
$LANG['formguide_add'] = '添加表单向导';
$LANG['formguide_edit'] = '修改表单向导';
$LANG['form_info_list'] = '信息列表';
$LANG['formguide_disabled'] = '禁用表单';
$LANG['formguide_delete'] = '删除表单';
$LANG['formguide_stat'] = '表单统计';
$LANG['add_public_field'] = '添加公共字段';
$LANG['list_public_field'] = '管理公共字段';
$LANG['module_setting'] = '模块配置';
$LANG['batch_add'] = '批量添加';
$LANG['wap_edit'] = '修改';
$LANG['wap_type_manage'] = '分类管理';
$LANG['wap_add'] = '添加站点';
$LANG['wap_delete'] = '删除';
$LANG['wap_type_edit'] = '分类编辑';
$LANG['wap_type_delete'] = '分类删除';
$LANG['info_setting'] = '信息模型设置';
$LANG['tag'] = '标签向导';
$LANG['add_tag'] = '添加标签向导';
$LANG['edit_tag'] = '修改标签向导';
$LANG['delete_tag'] = '删除标签向导';
$LANG['tag_lists'] = '标签向导列表';
$LANG['add_copyfrom'] = '添加来源';
$LANG['comment_manage'] = '评论管理';
$LANG['upgrade'] = '在线升级';
$LANG['checkfile'] = '文件校验';
$LANG['plugin'] = '应用';
$LANG['plugin'] = '应用';
$LANG['plugin_list'] = '应用列表';
$LANG['plugin_manage'] = '应用管理';
$LANG['plugin_install'] = '安装应用';
$LANG['plugin_list'] = '应用列表';
$LANG['plugin_import'] = '安装应用';
$LANG['yp_setting'] = '模块配置';
$LANG['yp_category_manage'] = '分类管理';
$LANG['yp_edit_category'] = '修改分类';
$LANG['yp_add_category'] = '添加分类';
$LANG['yp_model_manage'] = '黄页模型管理';
$LANG['add_yp_model'] = '添加模型';
$LANG['edit_yp_model'] = '修改模型';
$LANG['del_yp_model'] = '删除模型';
$LANG['ypmodel_import'] = '导入模型';
$LANG['disabled_ypmodel'] = '禁用模型';
$LANG['export_ypmodel'] = '导出模型';
$LANG['yp_fields_manage'] = '字段管理';
$LANG['yp_category_cache'] = '更新分类缓存';
$LANG['yp'] = '企业黄页';
$LANG['additional_field'] = '附加字段管理';
$LANG['company_template_manage'] = '企业模板管理';
$LANG['add_new_template'] = '添加新模板';
$LANG['setdefaulttpl'] = '设置默认模板';
$LANG['priv_setting'] = '权限设置';
$LANG['template_disabled'] = '模板启用关闭';
$LANG['template_delete'] = '模板删除';
$LANG['yp_info_manage'] = '信息管理';
$LANG['business_centre'] = '商务中心';
$LANG['plugin'] = '应用';
$LANG['appcenter'] = '应用中心';
$LANG['install_online'] = '在线安装';
$LANG['appcenter_detail'] = '应用详情';
$LANG['uninstall_plugin'] = '卸载应用';
$LANG['plugin_close'] = '关闭应用';
$LANG['install_plugin'] = '安装应用';
$LANG['tags'] = 'tags管理';
$LANG['tags_create'] = 'tags重建';
$LANG['order'] = '清单管理';
$LANG['brand'] = '品牌管理';
$LANG['update_brand_cache'] = '更新品牌缓存';
$LANG['update_brand_cache'] = '更新品牌缓存';
$LANG['update_brand_cache'] = '更新品牌缓存';
$LANG['poster'] = '广告';
$LANG['update_order_detail'] = '更新清单缓存';
$LANG['plugin_list'] = '已安装新应用';
$LANG['plugin_install'] = '安装新应用';
$LANG['plugin_import'] = '安装新应用';
$LANG['company_manage'] = '企业库管理';
$LANG['yp_company_manage'] = '企业库管理';
$LANG['资质证书管理'] = 'certificate_manage';
$LANG['certificate_manage'] = '资质证书管理';
$LANG['appcenter_detail'] = '应用详细信息';
$LANG['dianping'] = '点评';
$LANG['add_dianpin_type'] = '添加点评类型';
$LANG['dianping_setting'] = '点评配置';
$LANG['dianping_data'] = '点评信息列表';
$LANG['add_dianping_type'] = '添加点评类型';
$LANG['dianping_do_js'] = '更新点评配置缓存';
$LANG['export_category'] = '导出分类';
$LANG['del_category'] = '删除分类';
$LANG['listorder_category'] = '分类排序';
$LANG['add_yp_field'] = '添加字段';
$LANG['edit_yp_field'] = '修改字段';
$LANG['disabled_yp_field'] = '禁用字段';
$LANG['delete_yp_field'] = '删除字段';
$LANG['listorder_yp_field'] = '字段排序';
$LANG['edit_yp_content'] = '修改信息';
$LANG['push_yp_content'] = '信息推送';
$LANG['pass_yp_content'] = '信息审核/退稿';
$LANG['company_edit'] = '企业修改';
$LANG['company_delete'] = '企业删除';
$LANG['company_passed_check'] = '企业审核/取消审核';
$LANG['company_elite'] = '企业推荐/取消推荐';
$LANG['certificate_ht_edit'] = '资质证书修改';
$LANG['certificate_delete'] = '删除证书';
$LANG['passed_check_certificate'] = '审核证书';
$LANG['update_urls_menu'] = '更新企业导航';
$LANG['update_urls_category'] = '更新分类url地址';
$LANG['update_urls_content'] = '更新内容url';
$LANG['edit_dainpingtype'] = '修改点评类型';
$LANG['edit_dainping_type'] = '修改点评类型';
$LANG['delete_dianping_type'] = '删除点评类型';
$LANG['additional_add'] = '添加附加字段';
$LANG['additional_edit'] = '修改附加字段';
$LANG['additional_disabled'] = '禁用附件字段';
$LANG['additional_delete'] = '删除附加字段';
$LANG['additional_listorder'] = '附加字段排序';
$LANG['logistics'] = ' 物流管理';
$LANG['pl_setting'] = '模块设置';
?>
|
108wo
|
phpcms/languages/zh-cn/system_menu.lang.php
|
PHP
|
asf20
| 19,877
|
<?php
$LANG['the_site_not_release'] = '该站点无发布点';
$LANG['release_point_connect_failure'] = '节点『 {name} 』连接失败';
$LANG['peed_your_server'] = '同步速度视您的服务器,连接到发布点的速度而定。';
$LANG['are_release_ing'] = '正在同步中...';
$LANG['done'] = '[已完成]';
$LANG['sync_agin'] = '再次同步';
$LANG['site'] = '站点';
$LANG['path'] = '路径';
$LANG['time'] = '时间';
$LANG['upload'] = '上传';
$LANG['success'] = '成功';
$LANG['failure'] = '失败';
$LANG['not_upload'] = '没有上传';
$LANG['remind'] = '提醒';
$LANG['remind_message'] = '当删除文件的时候,如果一直无法执行成功,很可能服务器上没有该文件,请删除这条命令。';
|
108wo
|
phpcms/languages/zh-cn/release.lang.php
|
PHP
|
asf20
| 755
|
<?php
$LANG['added_external_data_source'] = '添加外部数据源';
$LANG['configure_the_external_data_source'] = '外部数据源配置';
$LANG['dbsource_name'] = '数据源名';
$LANG['edit_dbsource'] = '编辑数据源';
$LANG['server_address'] = '服务器地址';
$LANG['server_port'] = '服务器端口';
$LANG['password'] = '密码';
$LANG['database'] = '数据库名';
$LANG['dbtablepre'] = '数据表前缀';
$LANG['charset'] = '字符集';
$LANG['test_connections'] = '测试连接';
$LANG['connect_success'] = '连接成功!';
$LANG['connect_failed'] = '连接失败!';
$LANG['input_dbsource_name'] = '请输入数据源名,数据源应该由字母和数字组成。';
$LANG['data_source_of_the_letters_and_figures'] = '数据源应该由字母和数字组成。';
$LANG['server_ports_must_be_positive_integers'] = '服务器端口必须为正整数';
$LANG['adding_data_source_call'] = '添加数据源调用';
$LANG['the_module_will_not_support_the_operation'] = '该模块不支持,本次操作!';
$LANG['enter_the_cache_input_will_not_be_cached'] = '请输入缓存时间,不输入则不进行缓存。';
$LANG['cache_time_can_only_be_positive'] = '缓存时间只能正数。';
$LANG['that_shows_only_positive_numbers'] = '显示条数只能正数。';
$LANG['tip_pre'] = '填写后可用phpcms_代替get标签中的数据表前缀。';
$LANG['num'] = '调用数量';
$LANG['name'] = '名称';
$LANG['should'] = '应该';
$LANG['is_greater_than'] = '大于';
$LANG['less_than'] = '小于';
$LANG['lambda'] = '位';
$LANG['sure_deleted'] = '您确定删除所有选中的项目吗?';
$LANG['the_configuration_data_source'] = '数据源调用配置';
$LANG['stdcall'] = '调用方式';
$LANG['model_configuration'] = '模型配置';
$LANG['custom_sql'] = '自定义SQL';
$LANG['select_model'] = '选择模型';
$LANG['please_select_model'] = '请选择模型。';
$LANG['selectingoperation'] = '选择操作';
$LANG['please_select_action'] = '请选择操作';
$LANG['please_enter_a_sql'] = '请输入SQL。';
$LANG['vlan'] = '公共配置';
$LANG['output_mode'] = '输出方式';
$LANG['template'] = '模板';
$LANG['buffer_time'] = '缓存时间';
$LANG['editing_data_sources_call'] = '编辑数据源调用';
$LANG['valgrind'] = '你的代码';
$LANG['data_call'] = '调用代码';
$LANG['copy_code'] = '复制成功!';
?>
|
108wo
|
phpcms/languages/zh-cn/dbsource.lang.php
|
PHP
|
asf20
| 2,406
|
<?php
$LANG['member_init'] = '管理中心';
$LANG['account_manage'] = '账号管理';
$LANG['favorite'] = '收藏';
$LANG['123'] = '123';
$LANG['pay'] = '在线充值';
$LANG['business_centre'] = '商务中心';
?>
|
108wo
|
phpcms/languages/zh-cn/member_menu.lang.php
|
PHP
|
asf20
| 222
|
<?php
$LANG['operation'] = '操作';
$LANG['view'] = '查看';
$LANG['access'] = '访问';
$LANG['upgrade'] = '在线升级';
$LANG['checkfile'] = '文件校验';
$LANG['updatetime'] = '更新日期';
$LANG['updatelist'] = '可升级版本列表';
$LANG['currentversion'] = '当前版本';
$LANG['lastversion'] = '为最新版';
$LANG['covertemplate'] = '覆盖模版?';
$LANG['view_code'] = '查看代码';
$LANG['modifyfile'] = '修改过的文件';
$LANG['lastmodifytime'] = '最后修改时间';
$LANG['modifyedfile'] = '被修改文件';
$LANG['lostfile'] = '丢失文件';
$LANG['unknowfile'] = '未知文件';
$LANG['filesize'] = '文件大小';
$LANG['begin_checkfile'] = '开始校验文件,请稍候';
$LANG['begin_upgrade'] = '开始升级';
$LANG['upgradeing'] = '正在升级';
$LANG['upgrade_success'] = '升级成功!';
$LANG['lost'] = '丢失';
$LANG['file_address'] = '文件地址';
$LANG['please_check_filepri'] = '复制文件失败,请检查目录权限';
$LANG['check_file_notice'] = '注意:文件校验为根目录下所有文件以及phpcms、api、statics三个文件夹下所有目录和文件与默认程序同名文件md5值对比的结果,如果异常请用木马扫描工具扫描该文件是否包含木马';
$LANG['upgrade_notice'] = '注意:升级程序有可能覆盖模版文件,请注意备份!linux服务器需检查文件所有者权限和组权限,确保WEB SERVER用户有文件写入权限';
|
108wo
|
phpcms/languages/zh-cn/upgrade.lang.php
|
PHP
|
asf20
| 1,483
|
<?php
$LANG['node_add'] = '添加采集点';
$LANG['nodename'] = '名称';
$LANG['modelname'] = '模型名称';
$LANG['charset'] = '编码';
$LANG['content_num'] = '文章数';
$LANG['operation'] = '操作';
$LANG['adddate'] = '添加时间';
$LANG['lastdate'] = '最后采集时间';
$LANG['sure_delete'] = '您确定要删除吗?';
$LANG['basic_configuration'] = '基本信息';
$LANG['more_configuration'] = '详细信息';
$LANG['urlslist'] = '网址列表';
$LANG['sequence'] = '序列网址';
$LANG['multiple_pages'] = '多个网页';
$LANG['single_page'] = '单一网页';
$LANG['select_model'] = '请选择模型';
$LANG['not_to_collect'] = '没有内容可采集';
$LANG['url_collect_msg'] = '没有找到网址列表,请先进行网址采集。';
$LANG['collectioning'] = '采集正在进行中,采集进度:';
$LANG['collection_success'] = '采集完成!';
$LANG['please_select_cat'] = '请选择栏目';
$LANG['illegal_section_parameter'] = '非法栏目参数';
$LANG['model_does_not_exist_please_update_the_cache_model'] = '模型不存在!请更新模型缓存。';
$LANG['please_choose'] = '请选择';
$LANG['author'] = '作者';
$LANG['comeform'] = '来源';
$LANG['time'] = '时间';
$LANG['content'] = '内容';
$LANG['node_not_found'] = '采集节点没有找到';
$LANG['article_was_imported'] = '篇文章被导入。';
$LANG['are_imported_the_import_process'] = '正在导入中,导入进度:';
$LANG['url_list'] = '网址列表';
$LANG['in_all'] = '总共';
$LANG['all_count_msg'] = '条记录。重复记录';
$LANG['import_num_msg'] = '。去除重复记录,共入库';
$LANG['following_operation'] = '您现在可以还可以做以下的操作';
$LANG['following_operation_1'] = '1、开始采集文章内容';
$LANG['following_operation_2'] = '2、返回采集点管理';
$LANG['the_new_publication_solutions'] = '新建发布方案';
$LANG['category'] = '栏目';
$LANG['the_withdrawal_of_the_summary'] = '自动提取摘要';
$LANG['if_the_contents_of_intercepted'] = '是否截取内容';
$LANG['characters_to_a_summary_of_contents'] = '字符至内容摘要';
$LANG['the_withdrawal_of_thumbnails'] = '自动提取缩略图';
$LANG['whether_access_to_the_content_of'] = '是否获取内容第';
$LANG['picture_a_caption_pictures'] = '张图片作为标题图片';
$LANG['import_article_state'] = '导入文章状态';
$LANG['pendingtrial'] = '待审';
$LANG['fantaoboys'] = '审核通过';
$LANG['corresponding_labels_and_a_database_ties'] = '标签与数据库对应关系';
$LANG['the_original_database_field'] = '原数据库字段';
$LANG['explain'] = '数据库字段说明';
$LANG['label_field__collected_with_the_result_'] = '标签字段(采集填充结果)';
$LANG['publish_the_list'] = '发布方案列表';
$LANG['had_collected_from_the_roll'] = '原采集点名';
$LANG['the_new_gathering'] = '新采集点名';
$LANG['url_rewrites'] = '网址规则';
$LANG['content_rules'] = '内容规则';
$LANG['custom_rule'] = '自定义规则';
$LANG['eigrp'] = '高级配置';
$LANG['collection_items_of'] = '采集项目名';
$LANG['encode_varchar'] = '采集页面编码';
$LANG['web_sites_to_collect'] = '网址采集';
$LANG['url_type'] = '网址类型';
$LANG['url_configuration'] = '网址配置';
$LANG['test'] = '测试';
$LANG['url_msg'] = ' (如:http://www.phpcms.cn/help/rumen/(*).html,页码使用<a href="javascript:insertText(\'urlpage_1\', \'(*)\')">(*)</a>做为通配符。';
$LANG['page_from'] = '页码从';
$LANG['from'] = '从';
$LANG['to'] = '到';
$LANG['finish'] = '结束';
$LANG['increment_by'] = '每次增加 ';
$LANG['one_per_line'] = '每行一条';
$LANG['site_must_contain'] = '网址中必须包含 ';
$LANG['the_web_site_does_not_contain'] = '网址中不得包含 ';
$LANG['base_configuration'] = 'Base配置';
$LANG['base_msg'] = '如果目标网站配置了Base请设置。';
$LANG['get_url'] = '获取网址';
$LANG['rule_msg'] = '1、匹配规则请设置开始和结束符,具体内容使用“[内容]”做为通配符 。<BR>2、过滤选项格式为“要过滤的内容[|]替换值”,要过滤的内容支持正则表达式,每行一条。<BR>';
$LANG['expand_all'] = '全部展开';
$LANG['all_the'] = '全部合上';
$LANG['rule'] = '规则';
$LANG['matching_rule'] = '匹配规则';
$LANG['[content]'] = '[内容]';
$LANG['use'] = '使用';
$LANG['w_wildmenu'] = '作为通配符';
$LANG['filtering'] = '过滤选项';
$LANG['select'] = '选择';
$LANG['content_page'] = '内容分页';
$LANG['page_mode'] = '分页模式';
$LANG['all_are_models'] = '全部列出模式';
$LANG['down_the_pages_mode'] = '上下页模式';
$LANG['nextpage_rule'] = '下一页规则';
$LANG['nextpage_rule_msg'] = '请填写下一页超链接中间的代码。如:<a href="http://www.phpcms.cn/page_1.html">下一页</a>,他的“下一页规则”为“下一页”。';
$LANG['add_item'] = '添加项目';
$LANG['rulename'] = '规则名';
$LANG['rules_in_english'] = '规则英文名';
$LANG['download_pic'] = '下载图片';
$LANG['no_download'] = '不下载';
$LANG['watermark'] = '图片水印';
$LANG['gfl_sdk'] = '打水印';
$LANG['no_gfl_sdk'] = '不打水印';
$LANG['content_page_models'] = '内容分页';
$LANG['no_page'] = '不分页';
$LANG['by_the_paging'] = '按原文分页';
$LANG['sort_order'] = '导入顺序';
$LANG['with_goals_from_the_same'] = '与目标站相同';
$LANG['and_objectives_of_the_standing_opposite'] = '与目标站相反';
$LANG['testpageurl'] = '测试地址';
$LANG['invert'] = '反选';
$LANG['select_all'] = '全选';
$LANG['collect_call'] = '采集点名';
$LANG['cfg'] = '配置文件';
$LANG['only_support_txt_file_upload'] = '只支持.txt文件上传';
$LANG['collection_web_site'] = '采集网址';
$LANG['collection_content'] = '采集内容';
$LANG['public_content'] = '内容发布';
$LANG['copy'] = '复制';
$LANG['export'] = '导出';
$LANG['import_collection_points'] = '导入采集点';
$LANG['data_acquisition_testdat'] = '测试采集';
$LANG['copy_node'] = '复制采集';
$LANG['import_collection_points'] = '导入采集点';
$LANG['view'] = '查看';
$LANG['loading'] = '加载中...';
$LANG['content_view'] = '内容查看';
$LANG['content_list'] = '文章列表';
$LANG['all'] = '全部';
$LANG['if_bsnap_then'] = '未采集';
$LANG['spidered'] = '已采集';
$LANG['imported'] = '已导入';
$LANG['status'] = '状态';
$LANG['url'] = '网址';
$LANG['also_delete_the_historical'] = '同时删除历史';
$LANG['import_selected'] = '导入选中';
$LANG['import_all'] = '全部导入';
$LANG['select_article'] = '请选择文章';
$LANG['program_add_operation_success'] = '添加发布方案成功!';
$LANG['handler_functions'] = '处理函数';
?>
|
108wo
|
phpcms/languages/zh-cn/collection.lang.php
|
PHP
|
asf20
| 6,854
|
<?php
$LANG['reg_msg'] = '您还的网站还没有申请CNZZ统计,是否现在申请?<br><br><input type="button" onclick="location.href=\'?m=cnzz&c=index&a=public_regcnzz\'" value=" 马 上 开 通 "> <input type="button" onclick="history.back();" value=" 暂 不 开 通 ">';
$LANG['application_fails'] = '申请失败,请稍候再试。';
$LANG['donot_connect_server'] = '无法成功连接cnzz服务器。';
$LANG['has_been_registered'] = '已经注册过。';
|
108wo
|
phpcms/languages/zh-cn/cnzz.lang.php
|
PHP
|
asf20
| 475
|
<?php
$LANG['enter_the_cache_input_will_not_be_cached'] = '请输入缓存时间,不输入则不进行缓存。';
$LANG['cache_time_can_only_be_positive'] = '缓存时间只能正数。';
$LANG['that_shows_only_positive_numbers'] = '显示条数只能正数。';
$LANG['num'] = '调用数量';
$LANG['name'] = '名称';
$LANG['should'] = '应该';
$LANG['is_greater_than'] = '大于';
$LANG['less_than'] = '小于';
$LANG['lambda'] = '位';
$LANG['sure_deleted'] = '您确定删除所有选中的项目吗?';
$LANG['stdcall'] = '调用方式';
$LANG['model_configuration'] = '模型配置';
$LANG['custom_sql'] = '自定义SQL';
$LANG['select_model'] = '选择模型';
$LANG['please_select_model'] = '请选择模型。';
$LANG['selectingoperation'] = '选择操作';
$LANG['please_select_action'] = '请选择操作';
$LANG['please_enter_a_sql'] = '请输入SQL。';
$LANG['vlan'] = '公共配置';
$LANG['output_mode'] = '输出方式';
$LANG['template'] = '模板';
$LANG['buffer_time'] = '缓存时间';
$LANG['editing_data_sources_call'] = '编辑数据源调用';
$LANG['valgrind'] = '你的代码';
$LANG['data_call'] = '调用代码';
$LANG['copy_code'] = '复制成功!';
$LANG['add_tag'] = '添加标签向导';
$LANG['create_tag_success'] = '标签向导生成完成';
$LANG['block_name_not_empty'] = '碎片名称不能为空';
$LANG['edit_tag_success'] = '标签向导修改完成';
$LANG['stdcode'] = '调用代码';
$LANG['block'] = '碎片';
$LANG['tag_call_setting'] = '标签调用配置';
$LANG['over_dbsource'] = '外部数据源';
$LANG['please_select_dbsource'] = '请选择外部数据源。';
$LANG['please_input_block_name'] = '请输入碎片名称,以字母数字下划线组成;可以写入变量';
$LANG['ispage'] = '是否分页';
$LANG['common_variables'] = '常用变量';
$LANG['no_input_no_page'] = '不填写则不分页';
$LANG['data_return'] = '数据返回值';
$LANG['cache_times'] = '缓存时间';
$LANG['click_copy_code'] = '双击复制文本框中的代码';
$LANG['return_value'] = '请输入数据返回值,默认为:data。';
$LANG['the_module_will_not_support_the_operation'] = '该模块不支持,本次操作!';
?>
|
108wo
|
phpcms/languages/zh-cn/tag.lang.php
|
PHP
|
asf20
| 2,514
|
<?php
$LANG['send_message'] = '发送短消息';
$LANG['all_send_message'] = '群发短消息';
$LANG['message'] = '短消息';
$LANG['send'] = '发送';
$LANG['sendto'] = '发送到';
$LANG['subject'] = '标题';
$LANG['content'] = '内容';
$LANG['setting'] = '配置';
$LANG['touserid'] = '收件人';
$LANG['fromuserid'] = '发件人';
$LANG['send_time'] = '发信时间';
$LANG['reply'] = '回复';
$LANG['is_reply'] = '是否回复';
$LANG['remove_all_selected'] = '删除选中';
$LANG['user_noempty'] = '收件人不能为空';
$LANG['username'] = '用户名';
$LANG['time'] = '时 间';
$LANG['see_info'] = '查看详情';
$LANG['no_empty'] = '不能为空';
$LANG['before_select_operation'] = '请选择再执行操作';
$LANG['no_thisuser'] = '没有此用户';
$LANG['connecting'] = '正在连接,请稍候。';
$LANG['group'] = '按会员组';
$LANG['role'] = '按角色';
$LANG['send_num'] = '每轮发送次数';
$LANG['select']['send_from_id'] = '发件人';
$LANG['select']['send_to_id'] = '收件人';
$LANG['not_myself'] = '禁止给自己或非注册用户发送消息';
$LANG['sendtime'] = '发送时间';
$LANG['show_m'] = '显示';
$LANG['details'] = '查看详情';
$LANG['message_sender'] = '发 信 人';
$LANG['query_type'] = '查询类型';
$LANG['to'] = '至';
$LANG['message_not_exist'] = '短消息不存在';
$LANG['mass_failure'] = '群发失败,请检查!';
?>
|
108wo
|
phpcms/languages/zh-cn/message.lang.php
|
PHP
|
asf20
| 1,557
|
<?php
/*Language Format:
Add a new file(.lang.php) with your module name at /phpcms/languages/
translation save at the array:$LANG
*/
//index
$LANG['admin_site_title'] = 'phpcmsV9 - 后台管理中心';
$LANG['expand_or_contract'] = '展开与收缩';
$LANG['phpcms_title'] = 'PHPCMS V9内容管理系统';
$LANG['official_site'] = '官方网站';
$LANG['authorization'] = '授权';
$LANG['igenus_for_postfix'] = '支持论坛';
$LANG['help'] = '帮助?';
$LANG['hello'] = '您好!';
$LANG['exit'] = '退出';
$LANG['notice'] = '注意';
$LANG['site_homepage'] = '站点首页';
$LANG['member_center'] = '会员中心';
$LANG['search'] = '搜索';
$LANG['spread_or_closed'] = '展开与关闭';
$LANG['expand'] = '展开';
$LANG['update_backup'] = '更新缓存';
$LANG['current_position'] = '当前位置:';
$LANG['background_map'] = '后台地图';
$LANG['user_not_exist'] = '管理员不存在';
$LANG['password_error'] = '密码错误,您还有{times}次尝试机会!';
$LANG['password_error_lock'] = '密码错误,您还有';
$LANG['password_error_lock2'] = '次尝试机会!';
$LANG['wait_1_hour'] = '密码重试次数太多,请过{minute}分钟后重新登录!';
$LANG['wait_1_hour_lock'] = '密码重试次数太多';
$LANG['logout_success'] = '安全退出!';
$LANG['this_object_not_del'] = '该对象不能被删除';
$LANG['gd_unsupport'] = '<font color="red">不支持</font>';
$LANG['gd_support'] = '<font color="green">支持</font>';
//main
$LANG['main_hello'] = '您好,';
$LANG['main_role'] = '所属角色:';
$LANG['main_last_logintime'] = '上次登录时间:';
$LANG['main_last_loginip'] = '上次登录IP:';
$LANG['main_safety_tips'] = '安全提示';
$LANG['main_safety_permissions'] = '※ 强烈建议您将phpcms目录设置为644(linux/unix)或只读(NT)';
$LANG['main_safety_debug'] = '※ 强烈建议您网站上线后,建议关闭 DEBUG (前台SQL错误提示)';
$LANG['main_safety_errlog'] = '※ 强烈建议您网站开启错误日志(errorlog) ';
$LANG['main_safety_sql'] = '※ 强烈建议您关闭 execution_sql (执行SQL)';
$LANG['main_safety_log'] = '※ 您的错误日志记录超过警戒设置({size}),为避免影响性能,建议您及时清理';
$LANG['main_shortcut'] = '快捷方式';
$LANG['main_sysinfo'] = '系统信息';
$LANG['main_version'] = 'PHPCMS程序版本:';
$LANG['main_latest_version'] = '查看最新版本';
$LANG['main_os'] = '操作系统:';
$LANG['main_web_server'] = '服务器软件:';
$LANG['main_sql_version'] = 'MySQL 版本:';
$LANG['main_upload_limit'] = '上传文件:';
$LANG['main_copyright'] = '版权所有:';
$LANG['main_product_team'] = 'PHPCMS开发团队';
$LANG['main_product_planning'] = '总 策 划:';
$LANG['main_product_dev'] = '开发与支持团队:';
$LANG['main_product_ui'] = 'UI 设计:';
$LANG['main_product_site'] = '官方网站:';
$LANG['main_product_bbs'] = '官方论坛:';
$LANG['main_license'] = '授权信息';
$LANG['main_support'] = '技术支持与服务';
$LANG['main_license_type'] = '授权类型:';
$LANG['main_serial_number'] = '序列号:';
//menu.php
$LANG['menu_parentid'] = '上级菜单';
$LANG['menu_name'] = '菜单英文';
$LANG['module_name'] = '模块名';
$LANG['file_name'] = '文件名';
$LANG['action_name'] = '方法名';
$LANG['att_data'] = '附加参数';
$LANG['menu_url'] = '链接地址';
$LANG['menu_display'] = '是否显示菜单';
$LANG['menu_add'] = '添加菜单';
$LANG['menu_manage'] = '菜单管理';
$LANG['add_menu'] = '添加菜单';
$LANG['correlative_setting'] = '相关设置';
$LANG['menu_name'] = '菜单英文名称';
$LANG['chinese_name'] = '对应的中文语言名称';
$LANG['no_parent_menu'] = '作为一级菜单';
$LANG['no_site_permissions'] = '您没有站点权限,请联系管理员';
//down
$LANG['downserver_del_cofirm'] = '是否删除该镜像站?';
$LANG['downserver_name'] = '镜像站名称';
$LANG['downserver_url'] = '镜像站地址';
$LANG['downserver_site'] = '所属站点';
$LANG['downserver_del_success'] = '镜像站删除成功!';
$LANG['downserver_not_empty'] = '不能为空';
$LANG['downserver_error'] = '请填写服务器地址且不能以斜线结尾';
//position.php
$LANG['posid_manage'] = '推荐位管理';
$LANG['posid_add'] = '添加推荐位';
$LANG['posid_edit'] = '编辑推荐位';
$LANG['posid_catid'] = '所属栏目';
$LANG['posid_modelid'] = '所属模型';
$LANG['posid_name'] = '推荐位名称';
$LANG['posid_operation'] = '管理操作';
$LANG['posid_del_success'] = '删除成功!';
$LANG['posid_del_cofirm'] = '是否删除?';
$LANG['posid_item_view'] = '原文';
$LANG['posid_item_edit'] = '原文编辑';
$LANG['posid_item_remove'] = '移出';
$LANG['posid_select_model'] = '请选择模型';
$LANG['posid_select_to_remove'] = '请选择要移出的文章';
$LANG['position_tips'] = '此处如同时未选择模型与栏目,则该为全站通用;如选择模型未选择栏目,则该推荐位在该模型下通用。';
$LANG['posid_syn'] = '修改文章时同步?';
$LANG['posid_title'] = '推荐位标题';
$LANG['posid_thumb'] = '推荐位图片';
$LANG['posid_desc'] = '描述';
$LANG['posid_url'] = '链接地址';
$LANG['posid_inputtime'] = '推荐时间';
$LANG['posid_item_manage'] = '信息管理';
$LANG['posid_all'] = '全部';
$LANG['maxnum'] = '最大保存条数';
$LANG['posid_num'] = '条';
$LANG['extention_name'] = '扩展字段配置';
$LANG['extention_name_tips'] = '<strong>关于扩展字段</strong>:填写模型字段名称后该字段将保存入推荐位扩展字段中,格式:{字段名称}或者functionA({city},argv1),非开发者慎用!';
//role.php
$LANG['role_manage'] = '角色管理';
$LANG['role_add'] = '添加角色';
$LANG['role_edit'] = '修改角色';
$LANG['role_name'] = '角色名称';
$LANG['role_desc'] = '角色描述';
$LANG['role_status'] = '状态';
$LANG['role_operation'] = '管理操作';
$LANG['role_duplicate'] = '角色名称重复啦?';
$LANG['role_unlock'] = '启用';
$LANG['role_locked'] = '禁止';
$LANG['role_del_cofirm'] = '是否删除该角色?';
$LANG['role_del_success'] = '角色删除成功!';
$LANG['role_setting'] = '权限设置';
$LANG['role_member_manage'] = '成员管理';
$LANG['role_menuname'] = '菜单名称';
$LANG['role_menuserial'] = '序号';
$LANG['not_empty'] = $LANG['empty'];
$LANG['select_site'] = '请选择站点!';
$LANG['site_select'] = '站点选择';
//setting.php
$LANG['setting_yes'] = '是';
$LANG['setting_no'] = '否';
$LANG['setting_basic_cfg'] = '基本配置';
$LANG['setting_safe_cfg'] = '安全配置';
$LANG['setting_sso_cfg'] = 'PHPSSO';
$LANG['setting_mail_cfg'] = '邮箱配置';
$LANG['setting_admin_email'] = '管理员邮箱';
$LANG['setting_gzip'] = '启用页面Gzip压缩';
$LANG['setting_js_path'] = 'JS路径';
$LANG['setting_css_path'] = 'CSS路径';
$LANG['setting_img_path'] = '图片路径';
$LANG['setting_upload_url'] = '附件URL访问路径';
$LANG['setting_attachment_stat'] = '开启附件状态统计';
$LANG['setting_attachment_stat_desc'] = '<font color="gray">记录附件使用状态 ,删除文章时同步删除附件。注意: 本功能会加重服务器负担</font>';
$LANG['setting_admin_log'] = '启用后台管理操作日志';
$LANG['setting_error_log'] = '保存错误日志';
$LANG['setting_error_log_size'] = '错误日志预警大小';
$LANG['setting_adminaccessip'] = '允许访问后台的IP列表';
$LANG['setting_maxloginfailedtimes'] = '后台最大登陆失败次数';
$LANG['setting_maxiplockedtime'] = 'IP锁定时间';
$LANG['setting_minrefreshtime'] = '连续两次刷新最短间隔';
$LANG['setting_phpsso'] = '启用PHPSSO';
$LANG['update_phpsso_cache'] = '更新缓存';
$LANG['setting_phpsso_appid'] = '应用ID';
$LANG['setting_phpsso_phpsso_api_url'] = '接口地址';
$LANG['setting_phpsso_auth_key'] = '加密密钥';
$LANG['setting_phpsso_version'] = '版本号';
$LANG['must_be_number'] = '必须为数字';
$LANG['must_be_32_w'] = '为phpsso中该设置的密钥';
$LANG['setting_succ'] = '配置修改成功';
$LANG['test_email_succ'] = '测试邮件已经成功发送到:';
$LANG['test_email_faild'] = '邮件发送失败';
$LANG['mail_type'] = '邮件发送模式';
$LANG['mail_type_mail'] = 'mail 模块发送';
$LANG['mail_type_smtp'] = 'SMTP 函数发送';
$LANG['mail_server'] = '邮件服务器';
$LANG['mail_port'] = '邮件发送端口';
$LANG['mail_from'] = '发件人地址';
$LANG['mail_auth'] = 'AUTH LOGIN验证';
$LANG['mail_user'] = '验证用户名';
$LANG['mail_password'] = '验证密码';
$LANG['mail_auth_open'] = '开启';
$LANG['mail_auth_close'] = '关闭';
$LANG['mail_test'] = '邮件设置测试';
$LANG['mail_test_send'] = '测试发送';
$LANG['mail_auth_close'] = '关闭';
$LANG['setting_input'] = '请输入';
$LANG['setting_end_with_x'] = '请以“/”结尾';
$LANG['setting_input_error'] = '输入有误';
$LANG['setting_errorlog_hint'] = '错误记录文件超过此尺寸时,后台首页将会预警提示';
$LANG['setting_errorlog_size'] = '请输入文件尺寸';
$LANG['setting_errorlog_type'] = '文件尺寸为整数或小数';
$LANG['setting_phpsso_type'] = '请填写接口地址,格式为:http://www.phpsso.cn,结尾不包含“/”';
$LANG['setting_errorlog_hint'] = '请输入文件尺寸';
//admin_manage.php
$LANG['userid'] = '序号';
$LANG['password'] = '密码';
$LANG['security_code'] = '验证码';
$LANG['cofirmpwd'] = '确认密码';
$LANG['userinrole'] = '所属角色';
$LANG['lastloginip'] = '最后登录IP';
$LANG['lastlogintime'] = '最后登录时间';
$LANG['email'] = 'E-mail';
$LANG['realname'] = '真实姓名';
$LANG['admin_del_cofirm'] = '是否删除该管理员?';
$LANG['nameerror'] = '用户名不能为空。';
$LANG['between_2_to_20'] = '应该为2-20位之间';
$LANG['between_6_to_20'] = '应该为6-20位之间';
$LANG['password_can_not_be_empty'] = '密码不能为空。';
$LANG['passwords_not_match'] = '两次密码不同。';
$LANG['passwords_match'] = '密码输入一致';
$LANG['input'] = '请输入';
$LANG['connecting_please_wait'] = '请稍候...';
$LANG['not_change_the_password_please_leave_a_blank'] = '不修改密码请留空。';
$LANG['change_password'] = '修改密码';
$LANG['format_incorrect'] = '格式错误';
$LANG['format_right'] = '格式正确';
$LANG['admin_already_exists'] = '管理员名称已经存在';
$LANG['pwd_incorrect'] = '密码不合法';
$LANG['admin_cancel_succ'] = '管理员撤销成功';
$LANG['parameters_error'] = '参数不完整';
$LANG['username_illegal'] = '用户名不合法';
$LANG['email_illegal'] = 'email不合法';
$LANG['password_edit_succ_logout'] = '密码修改该成功,请使用新密码重新登录';
$LANG['old_password'] = '旧密码';
$LANG['new_password'] = '新密码';
$LANG['new_pwdconfirm'] = '重复新密码';
$LANG['old_password_wrong'] = '旧密码输入错误';
$LANG['old_password_right'] = '旧密码输入正确';
$LANG['email_already_exists'] = '该邮箱已经存在';
//database.php
$LANG['select_pdo'] = '请选择数据链接池';
$LANG['select_tbl'] = '请选择数据表';
$LANG['select_delfile'] = '请选择要删除的备份文件';
$LANG['only_fonder_operation'] = '只有创始人才能执行该操作';
$LANG['only_sql_down'] = '只能下载sql文件';
$LANG['dir_not_be_created'] = '目录无法创建';
$LANG['bakup_file'] = '备份文件';
$LANG['bakup_succ'] = '备份成功';
$LANG['bakup_write_succ'] = '写入成功';
$LANG['bundling'] = '分卷:';
$LANG['bakup_data_file'] = '数据文件';
$LANG['data_recover_succ'] = '数据库恢复成功!';
$LANG['backup_setting'] = '分卷备份设置';
$LANG['sizelimit'] = '每个分卷文件大小';
$LANG['sqlcompat'] = '建表语句格式';
$LANG['default'] = '默认';
$LANG['sqlcharset'] = '强制字符集';
$LANG['backup_starting'] = '开始备份数据';
$LANG['pdo_name'] = '链接池';
$LANG['reselect'] = '反选';
$LANG['database_tblname'] = '表名';
$LANG['database_type'] = '类型';
$LANG['database_char'] = '编码';
$LANG['database_records'] = '记录数';
$LANG['database_size'] = '使用空间';
$LANG['database_block'] = '碎片';
$LANG['database_op'] = '操作';
$LANG['database_optimize'] = '优化';
$LANG['database_repair'] = '修复';
$LANG['database_showcreat'] = '结构';
$LANG['batch_optimize'] = '批量优化';
$LANG['batch_repair'] = '批量修复';
$LANG['select_pdo_op'] = '请选择要操作的数据链接池';
$LANG['pdo_look'] = '查看';
$LANG['backup_file_name'] = '文件名称';
$LANG['backup_file_size'] = '文件大小';
$LANG['backup_file_time'] = '备份时间';
$LANG['backup_file_number'] = '卷号';
$LANG['backup_import'] = '数据恢复';
$LANG['backup_down'] = '下载';
$LANG['backup_del'] = '删除备份文件';
$LANG['database_sorry'] = '对不起';
$LANG['database_not_exist'] = '数据库文件不存在';
$LANG['data_have_load_to_database'] = '中的数据已经成功导入到数据库!';
$LANG['load_success'] = '上传成功!';
// linkage.php
$LANG['linkage_name'] = '菜单名称';
$LANG['linkage_add'] = '添加联动菜单';
$LANG['linkage_desc'] = '菜单描述';
$LANG['linkage_calling_code'] = '调用代码';
$LANG['linkage_manage_submenu'] = '管理子菜单';
$LANG['linkage_is_del'] = '是否删除菜单?';
$LANG['linkage_add_submenu'] = '添加子菜单';
$LANG['linkage_parameter_error'] = '参数错误';
$LANG['linkage_name_desc'] = '批量添加以换行分隔';
$LANG['linkage_option_style'] = '下拉风格';
$LANG['linkage_pop_style'] = '弹出风格';
$LANG['all_site'] = '所有站点';
$LANG['linkage_menu_style'] = '菜单风格';
$LANG['linkage_parent_menu'] = '上级菜单';
$LANG['site_select'] = '站点选择';
$LANG['linkage_not_empty'] = '不能为空';
$LANG['linkage_tips'] = '温馨提示:添加联动菜单后,请点击联动菜单后“更新缓存”按钮';
////IP禁止
$LANG['deblocking_time'] = '解封时间';
$LANG['time_isok'] = '日期合法';
$LANG['time_ismust'] = '必选日期';
$LANG['ip_exit'] = 'IP已存在';
$LANG['connecting'] = '正在连接,请稍候。';
$LANG['ip_type_error'] = '格式不是ip地址!';
//// keyword.php
$LANG['keyword_name'] = '关键词';
$LANG['keyword_listorder'] = '排序权值';
$LANG['quote_num'] = '引用次数';
$LANG['last_quote'] = '最后引用';
$LANG['click_num'] = '点击次数';
$LANG['last_vistor'] = '最后访问';
////敏感词
$LANG['badword_name'] = '敏感词';
$LANG['badword_replacename'] = '替换词';
$LANG['badword_level'] = '敏感级别';
$LANG['badword_listorder'] = '排序权值';
$LANG['badword_manage'] = '敏感词管理';
$LANG['badword_edit'] = '编辑敏感词';
$LANG['badword_confirm_del'] = '是否删除该敏感词';
$LANG['badword_common'] = '一般';
$LANG['badword_dangerous'] = '危险';
$LANG['badword_level_info'] = '(一般: 用替换词替换 , 危险: 直接去除)';
$LANG['badword_notreplace'] = '不填替换词了吗?';
$LANG['badword_noreplace'] = '替换词,可以为空';
$LANG['badword_pleasechose'] = '请选择再执行操作';
$LANG['badword_confom_del'] = '确认要删除 『 选中 』 吗?';
$LANG['badword_require'] = '要求';
$LANG['badword_import_infos'] = '1.文件要求每行一个敏感词条目;<br>
2.请使用英文标点,参数之间用英文","隔开。<br>
3.敏感级别由数字 1,2代替,1--一般;2--敏感;<br>';
//新闻协议
$LANG['google_info'] = '关于 Sitemaps/互联网新闻开放协议';
$LANG['google_rate'] = '更新频率';
$LANG['google_nums'] = '生成数量';
$LANG['google_sitemaps'] = '生成 Sitemaps';
$LANG['google_baidunews'] = '生成 互联网新闻开放协议';
$LANG['google_period'] = '更新周期';
$LANG['google_startmake'] = '开始生成';
$LANG['google_ismake'] = '生成XML文件';
$LANG['google_select_db'] = '选择数据来源';
$LANG['google_update'] = '一直更新';
$LANG['google_noupdate'] = '从不更新';
$LANG['google_hour'] = '小时';
$LANG['google_day'] = '天';
$LANG['google_week'] = '周';
$LANG['google_month'] = '月';
$LANG['google_year'] = '年';
$LANG['explain'] = '说明';
$LANG['google_infos'] = '<b>Sitemaps</b><br>
Sitemaps 服务旨在使用 Feed 文件 sitemap.xml 通知 Google、Yahoo! 以及 Microsoft 等 Crawler(爬虫)网站上哪些文件需要索引、这些文件的最后修订时间、更改频度、文件位置、相对优先索引权,这些信息将帮助他们建立索引范围和索引的行为习惯。详细信息请查看 sitemaps.org 网站上的说明。<br>
通过Sitemaps,您可以获得: <br>
1、更大的抓取范围,更新的搜索结果 – 帮助网友找到更多您的网页。<br>
2、更为智能的抓取 – 因为我们可以得知您网页的最新修改时间或网页的更改频率。<br>
3、详细的报告 – 详细说明 Google 如何将网友的点击指向您的网站及 Googlebot 如何看到您的网页。<br>
<B>互联网新闻开放协议:</B> <br>
1、互联网新闻开放协议》是百度新闻搜索制定的搜索引擎新闻源收录标准,网站可将发布的新闻内容制作成遵循此开放协议的XML格式的网页(独立于原有的新闻发布形式)供搜索引擎索引。 PHPCMS可自动生成网站的Sitemaps,但是您还需要向google或者baidu提交Sitemaps的访问地址。<br>
您的网站的Sitemaps 访问地址为:<?=APP_PATH?>sitemaps.xml<br>
PHPCMS可自动生成网站的<<互联网新闻开放协议>>,但是您还需要向baidu提交访问地址。<br>
您的网站的Sitemaps 访问地址为:<?=APP_PATH?>baidunews.xml<br>
更多关于Google Sitemaps的信息:https://www.google.com/webmasters/sitemaps/login?hl=zh_CN<br>
更多关于<<互联网新闻开放协议>>的信息:http://news.baidu.com/newsop.html#kg<br>';
//category
$LANG['catname'] = '栏目名称';
$LANG['please_select_parent_category'] = '≡ 作为一级栏目 ≡';
$LANG['parent_category'] = '上级栏目';
$LANG['category_manage'] = '管理栏目';
$LANG['add_category'] = '添加栏目';
$LANG['catdir'] = '英文目录';
$LANG['catgory_img'] = '栏目图片';
$LANG['description'] = '介绍';
$LANG['domain'] = '绑定域名';
$LANG['badword_add'] = '添加敏感词';
$LANG['remove_all_selected'] = '删除选中';
$LANG['category_cache'] = '更新栏目缓存';
$LANG['admin_setting'] = '管理员设置';
$LANG['admin_manage'] = '管理员管理';
$LANG['admin_add'] = '添加管理员';
$LANG['model_manage'] = '模型管理';
$LANG['add_model'] = '添加模型';
$LANG['select_model'] = '请选择模型';
$LANG['modelname'] = '所属模型';
$LANG['category_type'] = '栏目类型';
$LANG['link_url'] = '链接地址';
$LANG['items'] = '数据量';
$LANG['vistor'] = '访问';
$LANG['domain_help'] = '域名绑定须知';
$LANG['category_type_system'] = '内部栏目';
$LANG['category_type_page'] = '<font color="blue">单网页</font>';
$LANG['category_type_link'] = '<font color="red">外部链接</font>';
$LANG['add_sub_category'] = '添加子栏目';
$LANG['tips_domain'] = '将域名:';
$LANG['directory_binding'] = '绑定到目录';
$LANG['input_catname'] = '请输入栏目名称';
$LANG['input_dirname'] = '请输入目录名称';
$LANG['enter_the_correct_catname'] = '目录名称必须为字母、数字、下划线、中划线';
$LANG['catname_have_exists'] = '目录名称已存在';
$LANG['follow_catname_have_exists'] = '<br>以下栏目因目录名称已经存在,没有被添加:';
$LANG['domain_name_format'] = '域名可为空,格式应该为http://www.phpcms.cn/';
$LANG['domain_end_string'] = '格式应该为http://www.phpcms.cn/,请以‘/’结束';
$LANG['template_setting'] = '请在【模板设置】选项中设置模板';
$LANG['catgory_basic'] = '基本选项';
$LANG['catgory_createhtml'] = '生成HTML设置';
$LANG['catgory_template'] = '模板设置';
$LANG['catgory_seo'] = 'SEO 设置';
$LANG['catgory_private'] = '权限设置';
$LANG['catgory_readpoint'] = '收费设置';
$LANG['catgory_not_need_check'] = '不需要审核';
$LANG['add_workflow_tips'] = '不需要审核 ,如需审核:扩展 > 工作流 > 添加工作流';
$LANG['html_category'] = '栏目生成Html';
$LANG['html_show'] = '内容页生成Html';
$LANG['category_urlrules'] = '栏目页URL规则';
$LANG['show_urlrules'] = '内容页URL规则';
$LANG['create_to_rootdir'] = '是否生成到根目录';
$LANG['create_to_rootdir_tips'] = '当设置了 caches/configs/system.php 中的 html_root 时,将生成到该目录';
$LANG['available_styles'] = '可用风格';
$LANG['category_index_tpl'] = '栏目首页模板';
$LANG['category_list_tpl'] = '栏目列表页模板';
$LANG['content_tpl'] = '内容页模板';
$LANG['meta_title'] = '<strong>META Title(栏目标题)</strong><br/>针对搜索引擎设置的标题';
$LANG['meta_keywords'] = '<strong>META Keywords(栏目关键词)</strong><br/>关键字中间用半角逗号隔开';
$LANG['meta_description'] = 'META Description(栏目描述)</strong><br/>针对搜索引擎设置的网页描述';
$LANG['role_private'] = '角色权限';
$LANG['group_private'] = '会员组权限';
$LANG['group_name'] = '会员组名称';
$LANG['allow_vistor'] = '允许访问';
$LANG['allow_contribute'] = '允许投稿';
$LANG['contribute_add_point'] = '投稿奖励';
$LANG['contribute_add_point_tips'] = '点 (会员在此栏目发表信息时可以得到的点数,为负数时减积分)';
$LANG['default_readpoint'] = '默认收取';
$LANG['readpoint'] = '点';
$LANG['readpoint_tips'] = '(会员在此栏目下查看信息时,该信息默认的收费),当这里设置为0时,发布页设置了,可只对设置的文章收费,<font color="red">生成静态时收费无效</font>';
$LANG['money'] = '元';
$LANG['repeatchargedays'] = '重复收费设置';
$LANG['repeat_tips'] = '天内不重复收费';
$LANG['repeat_tips2'] = '最小设置为1天';
$LANG['category_cache_tips'] = '温馨提示:请在添加、修改栏目全部完成后';
$LANG['update_cache'] = '更新栏目缓存';
$LANG['input_linkurl'] = '请输入链接地址';
$LANG['page_templates'] = '单网页模板';
$LANG['edit_following_operation'] = '不要忘记进行栏目缓存更新哟';
$LANG['ismenu'] = '是否在导航显示';
$LANG['manage_sub_category'] = '管理子栏目';
//model field
$LANG['news'] = '新闻';
$LANG['picture'] = '图片';
$LANG['down'] = '下载';
$LANG['info'] = '信息';
$LANG['tablename'] = '数据表';
$LANG['field_manage'] = '字段管理';
$LANG['fieldname'] = '字段名';
$LANG['cnames'] = '别名';
$LANG['system'] = '系统';
$LANG['must_input'] = '必填';
$LANG['contribute'] = '投稿';
$LANG['badword_export'] = '敏感词导出';
$LANG['badword_import'] = '批量导入';
//site manage
$LANG['site_management'] = '站点管理';
$LANG['add_site'] = '添加站点';
$LANG['basic_configuration'] = '基本配置';
$LANG['site_dirname'] = '站点目录';
$LANG['site_name'] = '站点名';
$LANG['site_domain'] = '站点域名';
$LANG['seo_configuration'] = 'SEO配置';
$LANG['site_title'] = '站点标题';
$LANG['description'] = '描述';
$LANG['release_point_configuration'] = '发布点配置';
$LANG['template_style_configuration'] = '模板风格配置';
$LANG['style_name'] = '风格名';
$LANG['site_dirname_err_msg'] = '只能包括数字、字母、下划线三种类型。';
$LANG['site_domain_ex'] = '请填写域名,格式为:http://www.phpcms.cn/';
$LANG['site_domain_ex2'] = '格式应该为http://www.phpcms.cn/,请以‘/’结束';
$LANG['style_name_point'] = '请选择风格(至少选一个)';
$LANG['select_at_least_1'] = '至少选择1个';
$LANG['please_select_a_style'] = '请选择模板风格。';
$LANG['edit_site'] = '编辑站点';
$LANG['not_use_the_publishers_some'] = '不使用发布点';
$LANG['publishing_sites_to_other_servers'] = '将站点发布到别的服务器上';
$LANG['choose_release_point'] = '请选择发布点';
$LANG['please_select_a_site'] = '请选择站点';
$LANG['site_att_config'] = '附件配置';
$LANG['site_att_upload_maxsize'] = '允许上传附件大小';
$LANG['site_att_allow_ext'] = '允许上传附件类型';
$LANG['site_att_gb_check'] = 'GD库功能检测';
$LANG['site_att_watermark_enable'] = '是否开启图片水印';
$LANG['site_att_watermark_open'] = '启用';
$LANG['site_att_watermark_close'] = '关闭';
$LANG['site_att_watermark_condition'] = '水印添加条件';
$LANG['site_att_watermark_img'] = '水印图片';
$LANG['site_att_watermark_img_desc'] = '水印存放路径:statics/images/water';
$LANG['site_att_watermark_minwidth'] = '宽';
$LANG['site_att_watermark_minheight'] = '高';
$LANG['site_att_watermark_pct'] = '水印透明度';
$LANG['site_att_watermark_pct_desc'] = '请设置为0-100之间的数字,0代表完全透明,100代表不透明';
$LANG['site_att_watermark_quality'] = 'JPEG 水印质量';
$LANG['site_att_watermark_quality_desc'] = '水印质量请设置为0-100之间的数字,决定 jpg 格式图片的质量';
$LANG['site_att_watermark_pos'] = '水印位置';
$LANG['site_att_watermark_pos_10'] = '随机位置';
$LANG['site_att_watermark_pos_1'] = '顶部居左';
$LANG['site_att_watermark_pos_2'] = '顶部居中';
$LANG['site_att_watermark_pos_3'] = '顶部居右';
$LANG['site_att_watermark_pos_4'] = '中部居中';
$LANG['site_att_watermark_pos_5'] = '中部居左';
$LANG['site_att_watermark_pos_6'] = '中部居右';
$LANG['site_att_watermark_pos_7'] = '底部居左';
$LANG['site_att_watermark_pos_8'] = '底部居中';
$LANG['site_att_watermark_pos_9'] = '底部居右';
//release_point
$LANG['release_point_management'] = '发布点管理';
$LANG['release_point'] = '发布点';
$LANG['release_point_name'] = '发布点名';
$LANG['ftp_server'] = 'FTP服务器';
$LANG['server_address'] = '服务器地址';
$LANG['server_port'] = '服务器端口';
$LANG['passive_mode'] = '被动模式';
$LANG['ssl_connection'] = 'SSL连接';
$LANG['test_connections'] = '测试连接';
$LANG['server_ports_must_be_integers'] = '服务器端口必须为正整数';
$LANG['ftp_server_connections_success'] = 'FTP服务器连接成功!';
$LANG['ftp_connection_a_long_time'] = 'FTP连接时间过长,请优化FTP服务器。';
$LANG['can_ftp_server_connections'] = '无法连接FTP服务器';
$LANG['your_server_will_not_support_the_ssl_connection'] = '您的服务器不支持SSL方式连接';
$LANG['input_not_space'] = '输入内容请勿带空格';
$LANG['path'] = '主目录';
$LANG['most_choose_four'] = '最多选择4个';
//urlrule
$LANG['add_urlrule'] = '添加规则';
$LANG['urlrule_file'] = 'URL规则名称';
$LANG['urlrule_module'] = '模块名称';
$LANG['urlrule_ishtml'] = '是否生成静态?';
$LANG['urlrule_example'] = 'URL示例';
$LANG['urlrule_url'] = 'URL规则';
$LANG['urlrule_func'] = '可用变量';
$LANG['complete_part_path'] = '父栏目路径';
$LANG['category_path'] = '栏目目录';
$LANG['year'] = '年';
$LANG['month'] = '月';
$LANG['day'] = '日';
$LANG['respective_modules'] = '所属模块';
$LANG['rulename'] = '名称';
$LANG['edit_urlrule'] = '编辑规则';
//模块安装
$LANG['modulename'] = '模块名称';
$LANG['modulepath'] = '模块目录';
$LANG['moduleauthor'] = '作者';
$LANG['introduce'] = '模块简介';
$LANG['homepage'] = '作者主页';
$LANG['no_module'] = '请先确认要安装的模块!';
$LANG['this_module_installed'] = '系统内已存在该模块,请先卸载后再执行该安装程序!';
$LANG['success_module_install'] = '模块安装成功!';
$LANG['uninstall_success'] = '模块卸载成功!';
$LANG['versions'] = '版本号';
$LANG['installdate'] = '安装日期';
$LANG['updatetime'] = '更新日期';
$LANG['lang_dir_no_write'] = '语言包目录不可写!';
$LANG['module_sql_no_exist'] = 'module.sql不存在,请检查该文件是否在安装目录';
$LANG['model_clas_no_exist'] = '_model.class.php文件不存在,请先将该文件上传至数据模型目录!';
$LANG['sql_no_exist'] = '.sql 不存在,请检查该文件是否在安装目录';
$LANG['ban'] = '禁止';
$LANG['unload'] = '卸载';
$LANG['unknown'] = '未知';
$LANG['install_dir_no_exist'] = '安装程序目录不存在,请检查!';
$LANG['uninstall_dir_no_exist'] = '卸载程序目录不存在!';
$LANG['uninstall_now'] = '未安装';
$LANG['install'] = '安装';
$LANG['no_install'] = '无法安装';
$LANG['module_istall'] = '模块安装';
$LANG['module_unistall'] = '模块卸载';
$LANG['model_file_no_exists'] = '数据模型文件不存在,请先上传该文件至model文件夹下!';
//更新全站缓存
$LANG['downservers'] = '下载服务器';
$LANG['ipbanned'] = 'IP禁止';
$LANG['keylink'] = '关联链接';
$LANG['keylink_edit'] = '关联链接编辑';
$LANG['keylink_confirm_del'] = '是否删除该关联词';
$LANG['update_formguide_model'] = '更新表单向导模型';
$LANG['update_vote_setting'] = '更新投票模块配置';
$LANG['update_link_setting'] = '更新友情链接模块配置';
$LANG['linkage'] = '联动菜单';
$LANG['module'] = '模块';
$LANG['position'] = '推荐位';
$LANG['admin_role'] = '角色';
$LANG['sites'] = '站点';
$LANG['urlrule'] = 'url规则';
$LANG['sitemodel'] = '模型';
$LANG['type'] = '类别';
$LANG['workflow'] = '工作流';
$LANG['dbsource'] = '数据源';
$LANG['member_group'] = '会员列表';
$LANG['membermodel'] = '会员模型';
$LANG['member_model_field'] = '会员模型字段';
$LANG['search_type'] = '全站搜索分类';
$LANG['search_setting'] = '全站搜索配置';
$LANG['special'] = '专题';
$LANG['setting'] = '网站配置';
$LANG['database'] = '数据源模型';
$LANG['cache_file'] = '系统缓存文件';
$LANG['clear_files'] = '清理文件';
$LANG['update'] = '更新';
$LANG['cache_file_success'] = '缓存完成';
$LANG['site_cache_success'] = '缓存完成..........</li><li style=\"color: red;\">全站缓存更新成功';
$LANG['please_choose_the_default_style'] = '请选择默认风格';
$LANG['cache_copyfrom'] = '来源';
$LANG['please_select_a_style_and_select_the_template'] = '请选择风格后,选择默认模板。';
$LANG['default_style'] = '默认风格';
$LANG['your_server_it_may_not_have_access_to'] = '您的服务器,可能无法访问到';
$LANG['_please_check_the_server_configuration'] = ',请检查服务器配置。';
$LANG['phpcms_logon'] = 'phpcms 登录';
$LANG['please_input_your_password_the_picture_corresponding_location_6_digits'] = '请输入口令卡中图片对应位置的6位数字';
$LANG['ht_card'] = '口令卡';
$LANG['apply_for_a_password_card'] = '申请口令卡';
$LANG['the_password_card_binding'] = '解除口令卡绑定';
$LANG['the_password_card'] = '电子口令卡';
$LANG['your_website_opened_the_card_no_password'] = '您的网站没有启用口令卡。';
$LANG['card_msg'] = '1、如果要关闭本系统的口令卡支持,请配置config.php中的safe_card为0。<BR>2、口令卡一经申请3年内不使用,将会被删除。<BR>3、口令卡每小时最多申请 15 张。<BR>4、口令卡是一个安全措施,请谨慎保存口令卡。<BR>5、在口令卡上点击右键,选择“目标另存为”,保存到您的电脑上。您也可能打印成卡或存储到其他介质中。<BR>6、您需要先解除口令卡绑定,才可以申请新的口令卡。';
$LANG['user_id_cannot_be_empty'] = '用户ID不能为空!';
$LANG['users_were_not_found'] = '没有找到用户!';
$LANG['password_card_application_success'] = '口令卡申请成功!';
$LANG['the_binding_success'] = '解除绑定成功!';
$LANG['please_lift_the_password_card_binding'] = '请先解除口令卡绑定';
$LANG['click_change_validate'] = '单击更换验证码';
$LANG['a_card_with_a_local_database_please_contact_the_system_administrators'] = '口令卡存入本地数据库时失败,请联系系统管理员。';
$LANG['your_password_card_is_not_validate'] = '您的口令卡还没有通过验证';
$LANG['usersandmenus'] = '栏目权限';
$LANG['select_all'] = '全选';
$LANG['title_varchar'] = '栏目名称';
$LANG['view'] = '查看';
$LANG['add'] = '添加';
$LANG['sort'] = '排序';
$LANG['push'] = '推送';
$LANG['move'] = '移动';
$LANG['following_operation'] = '您可以进行以下的操作:';
$LANG['following_operation_1'] = '1、更新栏目缓存';
$LANG['following_operation_2'] = '2、返回继续添加栏目';
$LANG['setting_connect_notice'] = '如配置为空则前台不显示该connect登录';
$LANG['connect_enable'] = '是否开启外部通行证';
$LANG['connect_enable_notice'] = '如关闭,前台不显示所有connect登录';
$LANG['setting_connect'] = 'connect';
$LANG['setting_connect_enable'] = '开启connect';
$LANG['setting_connect_sina'] = '新浪微博';
$LANG['setting_connect_qq'] = '腾讯微博';
$LANG['setting_snda_enable'] = '盛大连接';
$LANG['snda_need_curl_init'] = ',但盛大通行证需服务器支持curl扩展';
$LANG['red'] = '红';
$LANG['green'] = '绿';
$LANG['blue'] = '蓝';
$LANG['lockscreen_status'] = '锁屏状态,请输入密码解锁';
$LANG['add_copyfrom'] = '添加来源';
$LANG['copyfrom_name'] = '来源名称';
$LANG['copyfrom_url'] = '来源链接';
$LANG['copyfrom_logo'] = '来源logo';
$LANG['copyfrom_url_tips'] = '请以http://开头';
$LANG['please_add_model'] = '请先添加模型';
$LANG['en_tips_type'] = '只能包括数字、字母、下划线三种类型';
$LANG['godaddy'] = '域名绑定目录';
$LANG['input_siteurl'] = '请输入网站网址';
$LANG['keylink_name'] = '关联链接名称';
$LANG['keylink_url'] = '关联链接网址';
$LANG['category_does_not_allow_delete'] = '该栏目已经存在内容,不允许删除';
$LANG['category_batch_tips'] = '提示:按住 Alt + 鼠标左键 可进行横向选择单选选项 ,方向键← →移动横向滚动条';
$LANG['please_select_category'] = '所选择类型下的栏目为空,请重新选择';
$LANG['modelid_edit_tips'] = ' <img src="./statics/images/icon/help.gif" title="当该栏目下数据为 0 时,可更换模型">';
$LANG['add_category_types'] = '添加方式';
$LANG['normal_add'] = '单条添加';
$LANG['batch_add_tips'] = '例如:<br><font color="#959595">国内新闻|china<br>国际新闻|world<br></font>竖线以及后面的英文名可留空,默认会自动生成栏目的拼音';
$LANG['not_display_in_menu'] = '不在导航显示';
$LANG['apply_to_child'] = '应用到子栏目:';
?>
|
108wo
|
phpcms/languages/zh-cn/admin.lang.php
|
PHP
|
asf20
| 35,268
|
<?php
$LANG['2s_close'] = '<font color="red"><B><span id="secondid">2</span></B> 秒后自动关闭</font>';
$LANG['news'] = '新闻';
$LANG['picture'] = '图片';
$LANG['down'] = '下载';
$LANG['info'] = '信息';
$LANG['string_limit'] = '介于<B>{minlength}</B> 到 <B>{maxlength}</B> 个字符之间';
$LANG['tablename'] = '数据表';
$LANG['field_manage'] = '字段管理';
$LANG['fieldname'] = '字段名';
$LANG['cnames'] = '别名';
$LANG['system'] = '系统';
$LANG['must_input'] = '必填';
$LANG['contribute'] = '投稿';
$LANG['basic_configuration'] = '基本信息';
$LANG['model_name'] = '模型名称';
$LANG['model_tablename'] = '模型表键名';
$LANG['description'] = '描述';
$LANG['template_setting'] = '模板设置';
$LANG['model_tablename_wrong'] = '表名必须为字母、数字、下划线';
$LANG['already_exist'] = '已经存在';
$LANG['between_1_to_20'] = '长度必须为1-20位';
$LANG['connecting_please_wait'] = '正在连接...请稍等';
$LANG['thumb'] = '缩略图';
$LANG['all_list'] = '所有文章';
$LANG['all_check_list'] = '所有待审内容';
$LANG['thumb_list'] = '包含缩略图';
$LANG['block_site_index'] = '站点首页';
$LANG['checkall_content'] = '审核内容';
$LANG['publish_to_othor_category'] = '同时发布到其他栏目';
//内容添加表单部分
$LANG['check_title'] = '检测重复';
$LANG['title_repeat'] = '标题重复';
$LANG['title_not_repeat'] = '标题不重复';
$LANG['mirror_server_list'] = '镜像服务器列表';
$LANG['attachment_upload'] = '附件上传';
$LANG['upload_soft'] = '上传软件';
$LANG['file_list'] = '文件列表';
$LANG['multiple_file_list'] = '多文件上传';
$LANG['add_remote_url'] = '添加远程地址';
$LANG['remove_out'] = '移除';
$LANG['upload_pic'] = '上传图片';
$LANG['upload_pic_max'] = '您最多可以同时上传';
$LANG['pic_list'] = '图片列表';
$LANG['select_pic'] = '选择图片';
$LANG['tips_pics'] = '张';
$LANG['islink_url'] = '转向链接';
$LANG['page_type1'] = '不分页';
$LANG['page_type2'] = '自动分页';
$LANG['page_type3'] = '手动分页';
$LANG['page_maxlength'] = '字符数(包含HTML标记)';
$LANG['upload_thumbnails'] = '请先上传缩略图';
$LANG['edit_content'] = '编辑:';
$LANG['not_meet_the_conditions'] = '不符合要求';
$LANG['not_less_than'] = '不得少于';
$LANG['not_more_than'] = '不得多于';
$LANG['the_value_must_not_repeat'] = '的值不得重复!';
//type
$LANG['add_type'] = '添加类别';
$LANG['select_model_name'] = '所属模型';
$LANG['type_name'] = '类型名称';
//workflow
$LANG['workflow_name'] = '工作流名称';
$LANG['steps'] = '审核级数';
$LANG['current_steps'] = '所处审核阶段';
$LANG['admin_users'] = '人员列表';
$LANG['workflow_diagram'] = '流程示意图';
$LANG['edit_workflow'] = '编辑工作流';
$LANG['steps_1'] = '一级审核';
$LANG['steps_2'] = '二级审核';
$LANG['steps_3'] = '三级审核';
$LANG['steps_4'] = '四级审核';
$LANG['confirm_delete_model'] = '确认要删除 『 {message} 』 吗?删除后,数据表将同时被删除!';
$LANG['workflow_0'] = '退稿';
$LANG['workflow_1'] = '一审';
$LANG['workflow_2'] = '二审';
$LANG['workflow_3'] = '三审';
$LANG['workflow_4'] = '四审';
$LANG['workflow_99'] = '审核通过';
$LANG['list'] = '列表';
$LANG['catid'] = '栏目ID';
$LANG['cat_tag'] = '栏目标签';
$LANG['sort'] = '排序';
$LANG['id_desc'] = '添加时间降序';
$LANG['updatetime_desc'] = '更新时间降序';
$LANG['listorder_asc'] = '排序升序';
$LANG['listorder_desc'] = '排序降序';
$LANG['subcat'] = '子栏目';
$LANG['siteid'] = '站点ID';
//down
$LANG['illegal_parameters'] = '参数错误';
$LANG['url_invalid'] = '地址失效';
$LANG['url_error'] = '地址错误';
$LANG['position'] = '推荐位';
$LANG['posid'] = '推荐位ID';
$LANG['posorder'] = '排序条件';
$LANG['possort'] = '顺序';
$LANG['id'] = 'ID';
$LANG['updatetime'] = '更新时间';
$LANG['posasc'] = '正序';
$LANG['posdesc'] = '逆序';
$LANG['add_content'] = '添加内容';
$LANG['check_passed'] = '审核通过';
$LANG['update_htmls'] = '批量更新_{catname}_列表';
$LANG['elite'] = '推荐';
$LANG['no_elite'] = '不推荐';
$LANG['related_articles'] = '相关文章';
$LANG['top'] = '排行榜';
$LANG['relevant_articles_id'] = '相关文章id';
$LANG['key_word'] = '关键词';
$LANG['reject'] = '退稿';
$LANG['publish_user'] = '发布人';
$LANG['today_hits'] = '今日点击';
$LANG['yestoday_hits'] = '昨日点击';
$LANG['week_hits'] = '本周点击';
$LANG['month_hits'] = '本月点击';
$LANG['member_contribute'] = '会员投稿';
$LANG['comment'] = '评论';
$LANG['createhtml'] = '批量生成HTML';
$LANG['passed_checked'] = '通过审核';
$LANG['view_comment'] = '查看评论';
$LANG['copyfrom_tips'] = '≡请选择≡';
$LANG['permission_to_operate'] = '您没有权限操作该项';
$LANG['missing_part_parameters'] = '缺少栏目ID';
$LANG['you_do_not_check'] = '您没有勾选信息';
$LANG['information_does_not_exist'] = '该信息不存在';
$LANG['after_a_few_seconds_left'] = '秒后自动离开...';
$LANG['please_add_category'] = '该站点下面还没有栏目,请先添加栏目';
$LANG['need_update_items'] = '共需更新 <font color="red">{total}</font> 条信息 - 已完成 <font color="red">{creatednum}</font> 条(<font color="red">{percent}%</font>)';
$LANG['create_update_success'] = '更新完成! ...';
$LANG['start_update_urls'] = '开始更新URL ...';
$LANG['updating'] = '正在更新';
$LANG['have_update_items'] = '有 <font color="red">{total}</font> 条信息 - 已完成 <font color="red">{creatednum}</font> 条(<font color="red">{percent}%</font>)';
$LANG['have_update_items'] = '有 <font color="red">{total}</font> 条信息 - 已完成 <font color="red">{creatednum}</font> 条(<font color="red">{percent}%</font>)';
$LANG['start_update'] = '开始更新 ...';
$LANG['start_update_category'] = '开始更新栏目页 ...';
$LANG['start_to_end_id'] = '" 第{page} - {endpage}页"';
$LANG['index_create_finish'] = '首页更新成功! 大小:{size}';
$LANG['add_content_position'] = '当前位置:内容 > 内容发布管理 > 添加内容';
$LANG['edit_content_position'] = '当前位置:内容 > 内容发布管理 > 修改内容';
$LANG['priview_model_position'] = '当前位置:内容 > 预览模型 > ';
$LANG['c_status'] = '状态';
$LANG['c_publish'] = '发布';
$LANG['c_check'] = '审核';
$LANG['save_close'] = '保存后自动关闭';
$LANG['save_continue'] = '保存并继续发表';
$LANG['c_close'] = '关闭(X)';
$LANG['dialog_close'] = '关闭';
$LANG['please_save_information'] = '您编辑的文章内容还没有进行保存!';
$LANG['page_manage'] = '单网页管理';
$LANG['title'] = '标题';
$LANG['intro'] = '简介';
$LANG['hits'] = '点击量';
$LANG['keywords'] = '关键词';
$LANG['content'] = '内容';
$LANG['c_template'] = '模板';
$LANG['explode_keywords'] = '多关键词之间用空格或者“,”隔开';
$LANG['search_category'] = '输入“拼音”或者“栏目名称”可快速搜索';
$LANG['quick_into'] = '快速进入';
$LANG['html_notice'] = '1、当设置有发布点时,生成静态页面完成后,请访问 内容 > 发布管理 > 同步到发布点 > ';
$LANG['according_model'] = '按照模型更新';
$LANG['select_category_area'] = '选择栏目范围';
$LANG['select_operate_content'] = '选择操作内容';
$LANG['no_limit_category'] = '不限栏目';
$LANG['every_time'] = '每轮更新';
$LANG['information_items'] = '条信息';
$LANG['update_all'] = '更新所有信息';
$LANG['submit_start_update'] = '开始更新';
$LANG['no_limit_model'] = '不限模型';
$LANG['last_information'] = '更新最新发布的';
$LANG['push_ctrl_to_select'] = '按住“Ctrl”或“Shift”键可以多选,按住“Ctrl”可取消选择';
$LANG['update_time_from'] = '更新发布时间从';
$LANG['to'] = '到';
$LANG['in_information'] = '的信息';
$LANG['update_id_from'] = '更新ID从';
$LANG['please_select_category'] = '不限栏目';
$LANG['catname'] = '栏目名称';
$LANG['confirm_delete'] = '确认删除吗?';
$LANG['push'] = '推送';
$LANG['push_to_position'] = '推送到推荐位';
$LANG['push_to_special'] = '推送到专题';
$LANG['belong_category'] = '所属栏目';
$LANG['addtime'] = '添加时间';
$LANG['contribute_time'] = '投稿时间';
$LANG['click_to_select'] = '点击选择';
$LANG['available_styles'] = '可用风格:';
$LANG['category_index_tpl'] = '栏目首页模板';
$LANG['category_list_tpl'] = '栏目列表页模板';
$LANG['content_tpl'] = '内容页模板';
$LANG['not_exists_push'] = '此模块还没有开启推送功能!';
$LANG['fieldname_was_wrong'] = '字段名称不正确';
$LANG['select_fieldtype'] = '请选择字段类型';
$LANG['input_right'] = '输入正确';
$LANG['input_nickname'] = '请输入别名';
$LANG['nickname_empty'] = '字段别名不能为空';
$LANG['model_manage'] = '模型管理';
$LANG['field_manage'] = '字段管理';
$LANG['add_field'] = '添加字段';
$LANG['manage_field'] = '管理模型字段';
$LANG['field_type'] = '字段类型';
$LANG['issystem_field'] = '作为主表字段';
$LANG['yes'] = '是';
$LANG['no'] = '否';
$LANG['fieldname'] = '字段名';
$LANG['fieldname_tips'] = '只能由英文字母、数字和下划线组成,并且仅能字母开头,不以下划线结尾';
$LANG['field_nickname'] = '字段别名';
$LANG['nickname_tips'] = '例如:文章标题';
$LANG['field_tip'] = '字段提示';
$LANG['field_tips'] = '显示在字段别名下方作为表单输入提示';
$LANG['relation_parm'] = '相关参数';
$LANG['relation_parm_tips'] = '设置表单相关属性';
$LANG['form_attr'] = '表单附加属性';
$LANG['form_attr_tips'] = '可以通过此处加入javascript事件';
$LANG['form_css_name'] = '表单样式名';
$LANG['form_css_name_tips'] = '定义表单的CSS样式名';
$LANG['string_size'] = '字符长度取值范围';
$LANG['string_size_tips'] = '系统将在表单提交时检测数据长度范围是否符合要求,如果不想限制长度请留空';
$LANG['minlength'] = '最小值';
$LANG['maxlength'] = '最大值';
$LANG['data_preg'] = '数据校验正则';
$LANG['data_preg_tips'] = '系统将通过此正则校验表单提交的数据合法性,如果不想校验数据请留空';
$LANG['often_preg'] = '常用正则';
$LANG['figure'] = '数字';
$LANG['integer'] = '整数';
$LANG['letter'] = '字母';
$LANG['integer_letter'] = '数字+字母';
$LANG['hyperlink'] = '超级链接';
$LANG['mobile_number'] = '手机号码';
$LANG['tel_number'] = '电话号码';
$LANG['zip'] = '邮政编码';
$LANG['data_passed_msg'] = '数据校验未通过的提示信息';
$LANG['unique'] = '值唯一';
$LANG['basic_field'] = '作为基本信息';
$LANG['basic_field_tips'] = '基本信息将在添加页面左侧显示';
$LANG['as_search_field'] = '作为搜索条件';
$LANG['allow_contributor'] = '在前台投稿中显示';
$LANG['as_fulltext_field'] = '作为全站搜索信息';
$LANG['as_postion_info'] = '在推荐位标签中调用';
$LANG['disabled_groups_field'] = '禁止设置字段值的会员组';
$LANG['disabled_role_field'] = '禁止设置字段值的角色';
$LANG['edit_field'] = '修改字段';
$LANG['field_disabled'] = '禁用';
$LANG['field_enabled'] = '<font color="red"> 启用</font>';
$LANG['import_model'] = '导入模型';
$LANG['edit_model'] = '编辑模型';
$LANG['export'] = '导出';
$LANG['template'] = '选择模板';
$LANG['type_name'] = '类别名称';
$LANG['edit_type'] = '编辑类别';
$LANG['updateurl_tips'] = '1、仅当内容页URL规则发上变化时,请批量更新,地址未改变时,不需要更新 。<BR>2、规则设置:设置 > 相关设置 > 管理栏目 > 添加或修改栏目';
$LANG['onclick_view'] = '点击查看';
$LANG['title_is_empty'] = '标题不能为空';
$LANG['subsidiary_table_datalost'] = '该信息数据不完整,请删除后,重新添加';
$LANG['click_vistor'] = '点击访问';
$LANG['visualization_edit'] = '碎片管理';
$LANG['starttime_than_endtime'] = '搜索的开始时间应该小于结束时间';
$LANG['day_select'] = '多少天内';
$LANG['no_limit'] = '不限';
$LANG['remove'] = '批量移动';
$LANG['move_to_categorys'] = '目标栏目';
$LANG['from_category'] = '从指定栏目';
$LANG['from_ids'] = '从指定ID';
$LANG['from_where'] = '指定来源';
$LANG['move_tips'] = '<font color="red">Tips:</font>多个问题ID请用\',\'隔开,<font color="red">注意不要换行</font>';
$LANG['ctrl_source_select'] = '源栏目可按Ctrl键多选';
$LANG['please_input_move_source'] = '请选择源栏目或者指定ID';
$LANG['please_select_target_category'] = '请选择目标栏目';
$LANG['type_name_tips'] = '请输入类别名称,多个类别用换行隔开';
$LANG['push_to_category'] = '推送到其他栏目';
$LANG['select_sitelist'] = '站点选择';
$LANG['category_checked'] = '已选栏目';
$LANG['as_omnipotent_field'] = '作为万能字段的附属字段';
$LANG['as_omnipotent_field_tips'] = '必须与万能字段结合起来使用,否则内容添加的时候不会正常显示';
$LANG['model_does_not_allow_delete'] = '该模型下已经有内容,不能删除';
$LANG['priview_modelfield'] = '预览模型';
$LANG['reject_message'] = '您的稿件被退回,请修改后重新提交';
$LANG['click_edit'] = '点击这里修改';
$LANG['reject_message_tips'] = '您发送的投稿不满足我们的要求,请重新编辑投稿!<BR>标题:';
$LANG['nocheck_users'] = '免审核人员';
$LANG['checkstatus_flag'] = '审核状态时是否允许修改';
$LANG['content_page'] = '内容页';
$LANG['reject_msg'] = '请输入退稿理由,退稿理由将会以短消息方式发送!';
$LANG['check_status'] = '<font color="#0000FF">当前审核状态 ></font>';
$LANG['cancel_the_picture'] = '取消图片';
$LANG['model_table_not_exists'] = '模型被禁用或者是模型内容表不存在';
//前台部分
$LANG['info_does_not_exists'] = '您要查看的信息不存在或者还未通过审批!';
$LANG['first_page'] = '第一页';
$LANG['last_page'] = '最后一页';
$LANG['category_not_exists'] = '栏目不存在';
$LANG['have_pay'] = '您已经支付过了!';
$LANG['msg_readpoint'] = '阅读信息消费';
$LANG['readpoint_pay'] = '阅读此内容,您为此付出了{readpoint}元';
$LANG['readpoint_pay_point'] = '阅读此内容,您为此付出了{readpoint}点';
$LANG['please_enter_content_to_search'] = '请输入要搜索的内容';
$LANG['search_minrefreshtime'] = '搜索间隔太短,请在{min}秒后再搜索';
$LANG['not_writable'] = '不可写';
$LANG['no_priv'] = '您没有访问该信息的权限!';
$LANG['guest_not_allowsearch'] = '游客不允许搜索,请先登录';
$LANG['cut_the_picture'] = '裁切图片';
$LANG['moreinfo'] = '调用副表';
$LANG['contribute_add_point'] = '投稿奖励';
?>
|
108wo
|
phpcms/languages/zh-cn/content.lang.php
|
PHP
|
asf20
| 15,268
|
<?php
/*Language Format:
Add a new file(.lang.php) with your module name at /phpcms/languages/
translation save at the array:$LANG
*/
$LANG['no_language'] = '缺少语言包';
$LANG['website_manage'] = 'phpcmsV9 - 后台管理中心';
$LANG['lockscreen'] = '锁屏';
$LANG['submit'] = '提 交';
$LANG['yes'] = '是';
$LANG['no'] = '否';
$LANG['error'] = '错误';
$LANG['illegal_operation'] = '非法操作!';
$LANG['illegal_action'] = '非法动作参数!请返回';
$LANG['illegal_parameters'] = '非法参数!';
$LANG['login_website'] = '请先登录网站!';
$LANG['login_success'] = '登录成功!';
$LANG['operation_success'] = '操作成功!';
$LANG['add_success'] = '数据添加成功!';
$LANG['operation_failure'] = '操作失败!';
$LANG['success'] = '成功!';
$LANG['failure'] = '失败!';
$LANG['total'] = '总数:';
$LANG['first'] = '首页';
$LANG['page_item'] = '条';
$LANG['previous'] = '上一页';
$LANG['next'] = '下一页';
$LANG['last'] = '尾页';
$LANG['page'] = '页次:';
$LANG['serial'] = '第';
$LANG['page'] = '页:';
$LANG['Sunday'] = '星期日';
$LANG['Monday'] = '星期一';
$LANG['Tuesday'] = '星期二';
$LANG['Wednesday'] = '星期三';
$LANG['Thursday'] = '星期四';
$LANG['Friday'] = '星期五';
$LANG['Saturday'] = '星期六';
$LANG['admin_login'] = '请先登录后台管理';
$LANG['add'] = '添加';
$LANG['edit'] = '编辑';
$LANG['delete'] = '删除';
$LANG['listorder'] = '排序';
$LANG['sys_setting'] = '设置';
$LANG['module'] = '模块';
$LANG['module_manage'] = '模块管理';
$LANG['category'] = '栏目';
$LANG['content'] = '内容';
$LANG['members'] = '用户';
$LANG['template_style'] = '界面';
$LANG['panel'] = '我的面板';
$LANG['selected'] = '选中';
$LANG['title'] = '标题';
$LANG['hits'] = '浏览次数';
$LANG['inputtime'] = '发表时间';
$LANG['operations_manage'] = '管理操作';
$LANG['selected'] = '选中';
$LANG['selected_all'] = '全选';
$LANG['cancel'] = '取消';
$LANG['all'] = '全部';
$LANG['confirm'] = '确认要删除 『 {message} 』 吗?';
$LANG['ok'] = '确定';
$LANG['clear'] = '清除';
$LANG['pass'] = '通过';
$LANG['unpass'] = '待审核';
$LANG['please_select'] = '请选择';
$LANG['items'] = '数据量';
$LANG['status'] = '状态';
$LANG['icon_unlock'] = '<font color="red">√</font>';
$LANG['icon_locked'] = '<font color="blue">×</font>';
$LANG['type'] = '类型';
$LANG['search'] = '搜索';
$LANG['username'] = '用户名';
$LANG['user_already_exist'] = '用户已存在。';
$LANG['poster'] = '广告';
$LANG['announce'] = '公告';
$LANG['template_select'] = '模板选择';
$LANG['input'] = '请输入';
$LANG['exists'] = '已存在。';
$LANG['connecting'] = '正在连接,请稍候。';
$LANG['empty'] = '不能为空。';
$LANG['notfound'] = '数据没有找到。';
$LANG['subtitle'] = '子标题';
$LANG['paging'] = '分页';
$LANG['insert_page_title'] = '在光标处插入带子标题的分页标记';
$LANG['insert_page_marker'] = '在光标处插入分页标记';
$LANG['ctrl_more_selected'] = '按住Ctrl可多选';
$LANG['file_does_not_writable'] = '文件不可写';
$LANG['file_does_not_exists'] = '文件不存在';
$LANG['file_exists'] = '文件已存在';
$LANG['copyright'] = 'CopyRight 2006-2011 <a href="http://www.sdo.com" target="_blank">上海盛大网络发展有限公司</a> B2-20040053 <a href="http://www.phpcms.cn" target="_blank">PHPCMS TEAM</a> ';
$LANG['input_right'] = '输入正确';
$LANG['update_success'] = '数据更新成功!';
$LANG['select_all'] = '全选';
$LANG['member_search'] = '搜索会员';
$LANG['input_code'] = '请输入验证码。';
$LANG['code_error'] = '验证码输入错误。';
$LANG['module_not_exists'] = '此模块未安装或已禁用!';
$LANG['part_cache_success'] = '系统缓存文件更新中:';
$LANG['message_tips'] = '提示信息';
$LANG['return_previous'] = '点这里返回上一页';
$LANG['close'] = '关闭';
$LANG['click_here'] = '如果您的浏览器没有自动跳转,请点击这里';
$LANG['position'] = '推荐位';
$LANG['no_setting'] = '没有设置';
$LANG['tip_zone'] = '提示区:';
$LANG['start_update'] = '开始更新';
$LANG['confirm_recovery'] = '确认恢复数据库吗?';
$LANG['mirrors_name'] = '镜像站名称';
$LANG['mirror_address'] = '镜像站地址';
$LANG['three_types'] = '只能包括数字、字母、下划线三种类型。';
$LANG['enter_correct'] = '输入正确!';
$LANG['change_level'] = '不更改排序级别?';
$LANG['delete_keywords'] = '是否删除该关键词';
$LANG['select_operations'] = '请选择再执行操作';
$LANG['menu_name'] = '菜单名称';
$LANG['menu_description'] = '菜单描述';
$LANG['menu_style'] = '菜单风格';
$LANG['drop_down_style'] = '下拉风格';
$LANG['pop_style'] = '弹出风格';
$LANG['sites'] = '站点';
$LANG['all_sites'] = '所有站点';
$LANG['cat_empty'] = '无(作为一级栏目)';
$LANG['click_select'] = '点击选择';
$LANG['level_menu'] = '上级菜单';
$LANG['file'] = '文件';
$LANG['time'] = '时间';
$LANG['ie8_tip'] = '使用IE8浏览器可获得最佳视觉效果';
$LANG['personal_information'] = '我的个人信息';
$LANG['ajax_tip'] = '通过AJAX 传递的方法,请使用 ajax_开头,方法为修改或删除操作时,请对应写成,ajax_edit_myaction/ajax_delete_myaction';
$LANG['for_chinese_lan'] = '对应的中文语言名称';
$LANG['manage'] = '管理';
$LANG['member_manage'] = '会员管理';
$LANG['application'] = '应用管理';
$LANG['communication'] = '通信信息';
$LANG['redeem'] = '积分兑换';
$LANG['administrator'] = '管理员管理';
$LANG['system_setting'] = '系统设置';
$LANG['update_cache'] = '更新缓存';
$LANG['exit'] = '退出';
$LANG['choose_model'] = '请选择模型';
$LANG['enable'] = '启用';
$LANG['close'] = '关闭';
$LANG['role_name'] = '角色名称';
$LANG['role_description'] = '角色描述';
$LANG['enabled'] = '是否启用';
$LANG['ban'] = '禁止';
$LANG['submit'] = '提交';
$LANG['need_subscribe'] = '需申请开通该功能';
$LANG['click_apply'] = '点击申请';
$LANG['snda_register_notice'] = '注意:审核时间为1-3个工作日,请通过审核后填写APPID,APPID为空则功能关闭';
$LANG['connect_micro'] = '连接微博';
$LANG['click_register'] = '点击注册';
$LANG['general'] = '一般';
$LANG['danger'] = '危险';
$LANG['enter_word'] = '请输入敏感词!';
$LANG['keywords_no_exist'] = '指定的关键词不存在!';
$LANG['export'] = 'badword.txt';
$LANG['not_information'] = '没有填写任何信息!';
$LANG['choose_category'] = '请选择栏目';
$LANG['create_success'] = '生成成功';
$LANG['specified_word_not_exist'] = '指定的关联词不存在!';
$LANG['open_module'] = '不限模块';
$LANG['miao'] = '秒';
$LANG['att_upload_succ'] = '文件上传成功';
$LANG['att_upload_limit_ini'] = '上传的文件超过了 php.ini 中 upload_max_filesize 选项限制的值';
$LANG['att_upload_limit_filesize'] = '上传文件的大小超过了 HTML 表单中 MAX_FILE_SIZE 选项指定的值';
$LANG['att_upload_limit_part'] = '文件只有部分被上传';
$LANG['att_upload_nofile'] = '没有文件被上传';
$LANG['att_upload_notemp'] = '找不到临时文件夹。';
$LANG['att_upload_temp_w_f'] = '文件写入临时文件夹失败';
$LANG['att_upload_create_dir_f'] = '附件目录创建不成功';
$LANG['att_upload_dir_permissions'] = '附件目录没有写入权限';
$LANG['att_upload_limit_ext'] = '不允许上传该类型文件';
$LANG['att_upload_limit_setsize'] = '文件超过了管理员限定的大小';
$LANG['att_upload_not_allow'] = '非法上传文件';
$LANG['att_upload_limit_time'] = '24小时内上传附件个数超出了系统限制';
$LANG['times'] = '时 间:';
$LANG['to'] = '至';
$LANG['determine_search'] = '确定搜索';
$LANG['removed_data'] = '删除一月前数据';
$LANG['add_submenu'] = '添加子菜单';
$LANG['modify'] = '修改';
$LANG['can_enter'] = '还可输入';
$LANG['characters'] = '个字符';
$LANG['attachmentupload'] = '附件上传';
$LANG['imagesupload'] = '上传图片';
$LANG['filesupload'] = '上传文件';
$LANG['hash_check_false'] = '[hash]数据验证失败';
$LANG['point'] = '点';
$LANG['money'] = '元';
$LANG['block_add'] = '添加碎片';
$LANG['click_to_down'] = '点击下载';
$LANG['linkage_select'] = '选择';
$LANG['ding_success'] = '置顶成功';
$LANG['province'] = '省';
$LANG['city'] = '市';
$LANG['not_meet_the_conditions'] = '不符合条件';
?>
|
108wo
|
phpcms/languages/zh-cn/system.lang.php
|
PHP
|
asf20
| 8,721
|
<?php
$LANG['configuration_file_save_to_the'] = '配置保存成功,开始文件统计...';
$LANG['documents_to_file_the_statistics'] = '文件统计完成, 开始文件筛选...';
$LANG['file_through_a_feature_the_function_is'] = '文件筛选完成,进行特征函数过滤...';
$LANG['feature_function_complete_a_code_used_by_filtration'] = '特征函数过滤完成,进行特征代码过滤...';
$LANG['scan_completed'] = '扫描完成!';
$LANG['scan_to_find_a_result_please_to_scan'] = '没有找到扫描结果,请重新扫描。';
$LANG['file_not_exists'] = '文件不存在!';
$LANG['please_wait'] = '正在对所的PHP文件生成MD5验证码,这个过程比较耗时,请等候...';
$LANG['viewreporttrue'] = '生成完成。';
$LANG['generate_progress'] = '生成进行中';
$LANG['characteristic_function'] = '特征函数';
$LANG['characteristic_key'] = '特征代码';
$LANG['ravsingle'] = '查杀目录';
$LANG['file_type'] = '文件类型';
$LANG['characteristic_function'] = '特征函数';
$LANG['characteristic_key'] = '特征代码';
$LANG['md5_the_mirror'] = 'MD5校验镜像';
$LANG['file_address'] = '文件地址';
$LANG['function_of_characteristics'] = '特征函数次数';
$LANG['code_number_of_features'] = '特征代码次数';
$LANG['operation'] = '操作';
$LANG['view'] = '查看';
$LANG['access'] = '访问';
$LANG['please_select_the_content'] = '请选择要搜索的内容';
$LANG['view_code'] = '查看代码';
|
108wo
|
phpcms/languages/zh-cn/scan.lang.php
|
PHP
|
asf20
| 1,486
|
<?php
/*Language Format:
Add a new file(.lang.php) with your module name at /phpcms/languages/
translation save at the array:$LANG
*/
$LANG['special'] = '专题';
$LANG['title_cannot_empty'] = '专题名称不能为空';
$LANG['add_special'] = '添加专题';
$LANG['add_special_success'] = '专题添加成功!';
$LANG['edit_special_success'] = '专题修改成功!';
$LANG['select_type'] = '请选择导入到的分类!';
$LANG['import_success'] = '导入成功,系统会自动过滤重复的信息!';
$LANG['select_model'] = '请选择模型';
$LANG['please_in_admin'] = '请在后台进行此操作!';
$LANG['banner_no_empty'] = '专题横幅地址不能为空';
$LANG['thumb_no_empty'] = '专题缩略图不能为空';
$LANG['content_add_success'] = '信息添加成功!';
$LANG['content_edit_success'] = '信息修改成功!';
$LANG['add_content'] = '添加信息';
$LANG['import_content'] = '信息导入';
$LANG['title_no_empty'] = '标题不能为空!';
$LANG['no_select_type'] = '没有选择所属分类';
$LANG['content_no_empty'] = '内容不能为空!';
$LANG['special_not_exist'] = '专题不存在或已删除!';
$LANG['content_checking'] = '您要查看的信息不存在或者还未通过审批!';
$LANG['special_setting'] = '专题设置';
$LANG['belong_category'] = '所属栏目';
$LANG['special_title'] = '专题名称';
$LANG['special_banner'] = '专题横幅';
$LANG['sepcial_thumb'] = '专题缩略图';
$LANG['special_intro'] = '专题导读';
$LANG['ishtml'] = '生成静态';
$LANG['special_filename'] = '专题生成目录';
$LANG['submit_no_edit'] = '提交后不能修改';
$LANG['index_page'] = '首页分页';
$LANG['special_template'] = '专题模板';
$LANG['special_content_template'] = '专题内容页模板';
$LANG['special_status'] = '专题状态';
$LANG['open'] = '开放';
$LANG['pause'] = '暂停';
$LANG['special_type_setting'] = '专题分类设置';
$LANG['special_type'] = '专题子分类';
$LANG['type_id'] = '分类ID';
$LANG['type_name'] = '分类名称';
$LANG['type_path'] = '分类路径';
$LANG['pics_news'] = '图片报道';
$LANG['choose_pic_news'] = '选择图片文章';
$LANG['choose_pic_model'] = '请选择图片模型的相关信息';
$LANG['add_vote'] = '加入投票';
$LANG['choose_exist_vote'] = '选择已有的投票';
$LANG['choose_vote'] = '选择投票';
$LANG['extend_setting'] = '扩展设置';
$LANG['add_new_vote'] = '新增投票';
$LANG['remove'] = '移除';
$LANG['special_type_template'] = '分类页模板';
$LANG['please_input_special_title'] = '请输入专题名称!';
$LANG['min_3_title'] = '专题名称不少于3个汉字';
$LANG['true'] = '正确!';
$LANG['server_no_data'] = '服务器没有返回数据,可能服务器忙,请重试';
$LANG['special_exist'] = '该专题已存在';
$LANG['checking'] = '正进行合法性校验...';
$LANG['please_upload_banner'] = '请上传专题横幅!';
$LANG['please_upload_thumb'] = '请上传专题缩略图!';
$LANG['special_file'] = '请输入专题页文件名,以便生成静态时使用';
$LANG['use_letters'] = '使用英文字母、数字或者下划线组成';
$LANG['please_input_name'] = '请输入文件名!';
$LANG['error'] = '输入错误!';
$LANG['for_type'] = '所属分类';
$LANG['keyword'] = '关键字';
$LANG['filename_exist'] = '该文件名已存在';
$LANG['input_type_name'] = '输入分类名称!';
$LANG['input_type_path'] = '输入分类路径!';
//批量更新
$LANG['update_special_success'] = '专题更新完成!';
$LANG['update_success'] = '更新完成!';
$LANG['index_update_success'] = '首页更新完成!';
$LANG['type_update_success'] = '分类页更新完成!';
$LANG['type_from'] = '分类,第 <font color="red">';
$LANG['type_end'] = '</font> 至第 <font color="red">';
$LANG['start_update_type'] = '开始更新分类页!';
$LANG['content_update_success'] = '内容页更新完成!';
$LANG['content_from'] = '内容第';
$LANG['index_create_finish'] = '专题首页更新成功!';
//添加、修改信息
$LANG['pos_info'] = '当前位置:专题 > 信息发布管理 > 添加信息';
$LANG['for_type'] = '所属分类';
$LANG['cancel_thumb'] = '取消图片';
$LANG['please_choose_type'] = '请选择分类';
$LANG['content_title'] = '标题';
$LANG['check_exist'] = '检测重复';
$LANG['title_exist'] = '标题重复';
$LANG['title_no_exist'] = '标题不重复';
$LANG['keywords'] = '关键词';
$LANG['more_keywords_with_blanks'] = '多关键词之间用空格或者“,”隔开';
$LANG['description'] = '摘要';
$LANG['content'] = '内容';
$LANG['iscutcontent'] = '是否截取内容';
$LANG['characters_to_contents'] = '字符至内容摘要';
$LANG['iscutcotent_pic'] = '是否获取内容第';
$LANG['picture2thumb'] = '张图片作为标题图片';
$LANG['paginationtype'] = '分页方式';
$LANG['no_page'] = '不分页';
$LANG['collate_copies'] = '自动分页';
$LANG['manual_page'] = '手动分页';
$LANG['number_of_characters'] = '字符数(包含HTML标记)';
$LANG['content_thumb'] = '缩略图';
$LANG['file_upload'] = '附件上传';
$LANG['author'] = '作者';
$LANG['islink'] = '转向链接';
$LANG['inputtime'] = '发布时间';
$LANG['template_style'] = '可用风格';
$LANG['show_template'] = '内容页模板';
$LANG['save'] = '保存';
$LANG['save_and_add'] = '保存并继续发表';
$LANG['close'] = '关闭';
$LANG['left_will_missing_data'] = '离开后,该页数据将丢失';
$LANG['please_choose_type'] = '请选择分类';
$LANG['please_input_title'] = '请输入标题';
$LANG['content_empty'] = '内容不能为空';
$LANG['edit_pos_info'] = '当前位置:专题 > 信息发布管理 > 修改信息';
//文章列表
$LANG['listorder'] = '排序';
$LANG['hits'] = '点击量';
$LANG['inputman'] = '发布人';
$LANG['update_time'] = '更新时间';
$LANG['content_edit'] = '修改';
$LANG['special_list'] = '专题列表';
$LANG['input_time'] = '发布时间';
$LANG['search'] = '搜索';
//信息导入
$LANG['import'] = '导 入';
$LANG['choose_news'] = '您先勾选导入的信息!';
//专题列表
$LANG['special_info'] = '专题信息';
$LANG['create_man'] = '创建人';
$LANG['create_time'] = '创建时间';
$LANG['add_news'] = '添加信息';
$LANG['import_news'] = '导入信息';
$LANG['manage_news'] = '管理信息';
$LANG['template_manage'] = '维护模板';
$LANG['elite_special'] = '推荐专题';
$LANG['remove_elite'] = '取消推荐';
$LANG['special_comment'] = '专题评论';
$LANG['edit_special'] = '修改专题';
$LANG['del_special'] = '删除专题';
$LANG['update'] = '更新';
$LANG['see_comment'] = '查看评论';
//维护模板
$LANG['quit_diy'] = '退出DIY';
$LANG['save_edit'] = '保存编辑';
$LANG['preview_diy'] = '预览DIY的效果';
$LANG['preview'] = '预览';
$LANG['custom'] = '自定义';
$LANG['upload_background'] = '上传背景图';
$LANG['remove_background'] = '取消背景图';
$LANG['restore_original_skin'] = '恢复原装皮肤';
$LANG['change'] = '更换';
$LANG['repeat_mode'] = '图片平铺';
$LANG['no-repeat'] = '直接使用';
$LANG['repeat'] = '平铺';
$LANG['repeat-x'] = '横向平铺';
$LANG['repeat-y'] = '纵向平铺';
$LANG['photo_place'] = '图片位置';
$LANG['background_scroll'] = '背景滚动';
$LANG['scroll'] = '滚动';
$LANG['fixed'] = '固定';
$LANG['bgcolor'] = '背景颜色';
$LANG['text_color'] = '文字颜色';
$LANG['link_color'] = '链接颜色';
$LANG['pc_tag'] = 'PC标签';
$LANG['show_diy'] = '展开DIY';
//clssess
$LANG['please_choose_special'] = '请选择专题!';
$LANG['content_list'] = '内容列表';
$LANG['hits_order'] = '浏览排序';
$LANG['sitename'] = '站点名称';
$LANG['iselite'] = '是否推荐';
$LANG['get_thumb'] = '调取缩略图';
$LANG['order_type'] = '排序方式';
$LANG['id_asc'] = 'ID 升序';
$LANG['id_desc'] = 'ID降序';
$LANG['order_asc'] = '排序 升序';
$LANG['order_desc'] = '排序 降序';
$LANG['special_id'] = '专题ID';
$LANG['total'] = '总数';
$LANG['yesterday'] = '昨日';
$LANG['today'] = '今日';
$LANG['week'] = '本周';
$LANG['month'] = '本月';
$LANG['please_upload_thumb'] = '请先上传缩略图';
$LANG['crop_thumb'] = '裁切图片';
?>
|
108wo
|
phpcms/languages/zh-cn/special.lang.php
|
PHP
|
asf20
| 9,298
|
<?php
$LANG['keyword_manage'] = '';
$LANG['keyword_name'] = '关键词';
$LANG['remove_all_selected'] = '删除选定的敏感词';
?>
|
108wo
|
phpcms/languages/zh-cn/keyword.lang.php
|
PHP
|
asf20
| 140
|
<?php
/*Language Format:
Add a new file(.lang.php) with your module name at /phpcms/languages/
translation save at the array:$LANG
*/
$LANG['trade_sn'] = '支付单号';
$LANG['addtime'] = '订单时间';
$LANG['to'] = '至';
$LANG['confirm_pay'] = '确认并支付';
$LANG['usernote'] = '备注';
$LANG['adminnote'] = '管理员操作';
$LANG['user_balance'] = '用户余额:';
$LANG['yuan'] = ' 元';
$LANG['dian'] = ' 点';
$LANG['trade_succ'] = '成功';
$LANG['checking'] = '验证中..';
$LANG['user_not_exist'] = '该用户不存在';
$LANG['input_price_to_change'] = '输入修改数量(资金或者点数)';
$LANG['number'] = '数量 ';
$LANG['must_be_price'] = '必须为金额,最多保留两位小数';
$LANG['reason_of_modify'] = '要修改的理由';
//modify_deposit.php
$LANG['recharge_type'] = '充值类型';
$LANG['capital'] = '资金';
$LANG['point'] = '点数';
$LANG['recharge_quota'] = '充值额度';
$LANG['increase'] = '增加';
$LANG['reduce'] = '减少';
$LANG['trading'] = '交易';
$LANG['op_notice'] = '提醒操作';
$LANG['op_sendsms'] = '发送短消息通知会员';
$LANG['op_sendemail'] = '发送e-mail通知会员';
$LANG['send_account_changes_notice'] = '账户变更通知';
$LANG['background_operation'] = '后台操作';
$LANG['account_changes_notice_tips'] = '尊敬的{username},您好!<br/>您的账户于{time}发生变动,操作:{op},理由:{note},当前余额:{amount}元,{point}积分。';
//payment.php
$LANG['basic_config'] = '基本设置';
$LANG['contact_email'] = '联系邮箱';
$LANG['contact_phone'] = '联系电话';
$LANG['order_info'] = '订单信息';
$LANG['order_sn'] = '支付单号';
$LANG['order_name'] = '名称';
$LANG['order_price'] = '订单价格';
$LANG['order_discount'] = '交易加价/涨价';
$LANG['order_addtime'] = '订单生成时间';
$LANG['order_ip'] = '订单生成IP';
$LANG['payment_type'] = '支付类型';
$LANG['order'] = '订单';
$LANG['disount_notice'] = '要给顾客便宜10元,降价请输入“-10”';
$LANG['discount'] = '订单改价';
$LANG['recharge'] = '在线充值';
$LANG['offline'] = '线下支付';
$LANG['online'] = '在线支付';
$LANG['selfincome'] = '自助获取';
$LANG['order_time'] = '支付时间';
$LANG['business_mode'] = '业务方式';
$LANG['payment_mode'] = '支付方式';
$LANG['deposit_amount'] = '存入金额';
$LANG['pay_status'] = '付款状态';
$LANG['pay_btn'] = '付款';
$LANG['name'] = '名称';
$LANG['desc'] = '描述';
$LANG['pay_factorage'] = '支付手续费';
$LANG['pay_method_rate'] = '按比例收费';
$LANG['pay_method_fix'] = '固定费用';
$LANG['pay_rate'] = '费率';
$LANG['pay_fix'] = '金额';
$LANG['pay_method_rate_desc'] = '说明:顾客将支付订单总金额乘以此费率作为手续费;';
$LANG['pay_method_fix_desc'] = '说明:顾客每笔订单需要支付的手续费;';
$LANG['parameter_config'] = '参数设置';
$LANG['plus_version'] = '插件版本';
$LANG['plus_author'] = '插件作者';
$LANG['plus_site'] = '插件网址';
$LANG['plus_install'] = '安装';
$LANG['plus_uninstall'] = '卸载';
$LANG['check_confirm'] = '确认要通过订单 {sn} 审核?';
$LANG['check_passed'] = '审核通过';
$LANG['change_price'] = '改价';
$LANG['check'] = '审核';
$LANG['closed'] = '关闭';
$LANG['thispage'] = '本页';
$LANG['finance'] = '财务';
$LANG['totalize'] = '总计';
$LANG['amount'] = '金额';
$LANG['total'] = '总';
$LANG['bi'] = '笔';
$LANG['trade_succ'] = '成功';
$LANG['transactions'] = '交易量';
$LANG['trade'] = '交易';
$LANG['trade_record_del'] = '确认删除该记录?';
/******************error & notice********************/
$LANG['illegal_sign'] = '签名错误';
$LANG['illegal_notice'] = '通知错误';
$LANG['illegal_return'] = '信息返回错误';
$LANG['illegal_pay_method'] = '支付方式错误';
$LANG['illegal_creat_sn'] = '订单号生成错误';
$LANG['pay_success'] = '恭喜您,支付成功';
$LANG['pay_failed'] = '支付失败,请联系管理员';
$LANG['payment_failed'] = '支付方式发生错误';
$LANG['order_closed_or_finish'] = '订单已完成或该已经关闭';
$LANG['state_change_succ'] = '状态修改完成';
$LANG['delete_succ'] = '删除成功';
$LANG['public_discount_succ'] = '操作成功';
$LANG['admin_recharge'] = '后台充值';
/******************pay status********************/
$LANG['all_status'] = '全部状态';
$LANG['unpay'] = '<font color="red" class="onError">交易未支付</font>';
$LANG['succ'] = '<font color="green" class="onCorrect">交易成功</font>';
$LANG['failed'] = '交易失败';
$LANG['error'] = '交易错误';
$LANG['progress'] = '<font color="orange" class="onTime">交易处理中</font>';
$LANG['timeout'] = '交易超时';
$LANG['cancel'] = '交易取消';
$LANG['waitting'] = '<font color="orange" class="onTime">等待付款</font>';
$LANG['select']['unpay'] = '交易未支付';
$LANG['select']['succ'] = '交易成功';
$LANG['select']['progress'] = '交易处理中';
$LANG['select']['cancel'] = '交易取消';
/*************pay plus language***************/
$LANG['alipay'] = '支付宝';
$LANG['alipay_account'] = '支付宝帐户';
$LANG['alipay_tip'] = '支付宝是国内领先的独立第三方支付平台,由阿里巴巴集团创办。致力于为中国电子商务提供“简单、安全、快速”的在线支付解决方案。<a href="http://www.alipay.com" target="_blank"><font color="red">立即在线申请</font></a>';
$LANG['alipay_key'] = '交易安全校验码(key)';
$LANG['alipay_partner'] = '合作者身份(parterID)';
$LANG['service_type'] = '选择接口类型';
$LANG['tenpay_account'] = '财付通客户号';
$LANG['tenpay_privateKey'] = '财付通私钥';
$LANG['tenpay_authtype'] = '选择接口类型';
$LANG['chinabank'] = '网银在线';
$LANG['chinabank_tip'] = '网银在线与中国银行、中国工商银行、中国农业银行、中国建设银行、招商银行等国内各大银行,以及VISA、MasterCard、JCB等国际信用卡组织保持了长期、紧密、良好的合作关系。<a href="http://www.chinabank.com.cn" target="_blank"><font color="red">立即在线申请</font>';
$LANG['chinabank_account'] = '网银在线商户号';
$LANG['chinabank_key'] = '网银在线MD5私钥';
$LANG['sndapay'] = '盛付通';
$LANG['sndapay_tip'] = '盛付通是盛大网络创办的中国领先的在线支付平台,致力于为互联网用户和企业提供便捷、安全的支付服务。通过与各大银行、通信服务商等签约合作,提供具备相当实力和信誉保障的支付服务。<a href="http://www.shengpay.com/HomePage.aspx?tag=phpcms" target="_blank"><font color="red">立即在线申请</font>';
$LANG['sndapay_account'] = '盛大支付商户号';
$LANG['sndapay_key'] = '盛大支付密钥';
$LANG['service_type_range'][0] = '使用担保交易接口';
$LANG['service_type_range'][1] = '使用标准双接口';
$LANG['service_type_range'][2] = '使用即时到账交易接口';
$LANG['userid'] = '用户ID';
$LANG['op'] = '操作人';
$LANG['expenditure_patterns'] = '消费类型';
$LANG['money'] = '金钱';
$LANG['point'] = '积分';
$LANG['from'] = '从';
$LANG['content_of_consumption'] = '消费内容';
$LANG['empdisposetime'] = '消费时间';
$LANG['consumption_quantity'] = '消费数量';
$LANG['self'] = '自身';
$LANG['wrong_time_over_time_to_time_less_than'] = '错误的时间格式,结束时间小于开始时间!';
$LANG['spend_msg_1'] = '请对消费内容进行描述。';
$LANG['spend_msg_2'] = '请输入消费金额。';
$LANG['spend_msg_3'] = '用户不能为空。';
$LANG['spend_msg_6'] = '账户余额不足。';
$LANG['spend_msg_7'] = '消费类型为空。';
$LANG['spend_msg_8'] = '数据存入数据库时出错。';
$LANG['bank_transfer'] = '银行转账';
$LANG['transfer'] = '银行汇款/转账';
$LANG['dsa'] = 'DSA 签名方法待后续开发,请先使用MD5签名方式';
$LANG['alipay_error'] = '支付宝暂不支持{sign_type}类型的签名方式';
$LANG['execute_date'] = '执行日期';
$LANG['query_stat'] = '查询统计';
$LANG['total_transactions'] = '总交易数';
$LANG['transactions_success'] = '成功交易';
$LANG['pay_tip'] = '我们目前支持的汇款方式,请根据您选择的支付方式来选择银行汇款。汇款以后,请立即通知我们。';
?>
|
108wo
|
phpcms/languages/zh-cn/pay.lang.php
|
PHP
|
asf20
| 8,552
|
<?php
/*Language Format:
Add a new file(.lang.php) with your module name at /phpcms/languages/
translation save at the array:$LANG
*/
$LANG['plugin_not_exist'] = '该应用不存在或者未开启,请联系站长!';
$LANG['plugin_error_or_not_exist'] = 'Plugin Error:该应用不存在或者应用存在语法错误';
$LANG['plugin_lacks_uninstall_file'] = '缺少卸载文件';
$LANG['plugin_uninstall_success'] = '应用卸载成功';
$LANG['plugin_uninstall_fail'] = '应用卸载失败';
$LANG['plugin_allready_exists'] = '应用已存在';
$LANG['plugin_configure_success'] = '应用配置成功';
$LANG['plugin_mkdir_fail'] = '创建文件夹失败,请检查Web目录确定plugin文件夹有写入权限';
$LANG['plugin_config_not_exist'] = '应用配置文件不存在';
$LANG['plugin_not_exist_or_pending'] = '应用不存在或未通过认证';
$LANG['plugin_developing'] = '应用正在开发中尚未通过审核';
$LANG['plugin_be_locked'] = '应用被锁定,请联系PHPCMS';
$LANG['plugin_illegal_id'] = '不合法的应用identification';
$LANG['plugin_illegal_variable'] = '不合法的应用变量名称';
$LANG['plugin_duplication_name'] = '该应用已经安装过或者与安装过的应用重名';
$LANG['plugin_incompatible'] = '该插件不兼容目前版本,该插件只能运行在';
$LANG['plugin_install_success'] = '应用安装成功';
$LANG['plugin_install_fail'] = '应用安装失败';
$LANG['plugin_item'] = '条';
$LANG['plugin_firstpage'] = '首页';
$LANG['plugin_lastpage'] = '尾页';
$LANG['plugin_prepage'] = '上一页';
$LANG['plugin_nextpage'] = '下一页';
$LANG['plugin_desc'] = '简介';
$LANG['plugin_config'] = '配置';
$LANG['plugin_uninstall_confirm'] = '确认卸载';
$LANG['plugin_uninstall_cancel'] = '取 消';
$LANG['plugin_agree'] = '我 同 意';
$LANG['plugin_disagree'] = '我不同意';
$LANG['plugin_install_app'] = '安装此应用';
$LANG['plugin_listorder'] = '显示顺序';
$LANG['plugin_list_name'] = '应用名称';
$LANG['plugin_list_version'] = '版本';
$LANG['plugin_list_copy'] = '版权信息';
$LANG['plugin_list_dir'] = '应用目录';
$LANG['plugin_close'] = '关闭';
$LANG['plugin_open'] = '开启';
$LANG['plugin_uninstall'] = '卸载';
$LANG['plugin_install'] = '安装';
$LANG['plugin_visit'] = '访问';
$LANG['plugin_config'] = '配置';
$LANG['plugin_app_all'] = '全部';
$LANG['plugin_free'] = '免费';
$LANG['plugin_not_free'] = '收费';
$LANG['plugin_author'] = '开发者';
$LANG['plugin_pub'] = '插件发布页面';
$LANG['plugin_click_download'] = '点击下载';
$LANG['plugin_reg_time'] = '注册时间:';
$LANG['plugin_copyright'] = '版权归属:';
$LANG['plugin_copyright_info'] = '© CopyRight 2005-2011 上海盛大网络发展有限公司 B2-20040053';
$LANG['download_fail'] = '下载失败,请手动下载';
$LANG['download_success'] = '下载成功,正在安装请稍候';
$LANG['install_online'] = '在线安装';
$LANG['install_plugin'] = '安装应用';
$LANG['uninstall_plugin'] = '卸载应用';
$LANG['plugin_lack_of_necessary_configuration_items'] = '应用安装文件缺少配置所需的必填项目,请检查';
$LANG['plugin_uninstall_success_no_delete'] = '文件卸载成功,但由于权限问题目录无法删除,请手动删除。';
$LANG['plugin_debug_tips'] = '您目前的开发模式为调试模式,关闭调试模式请设置configs\system.php中plugin_debug为0,<a href="http://help.open.phpcms.cn/2011/developer_0530/330.html" target="_blank">详细>></a>';
?>
|
108wo
|
phpcms/languages/zh-cn/plugin.lang.php
|
PHP
|
asf20
| 3,608
|
<?php
$LANG['add_keylink'] = '添加关联链接';
$LANG['keylink_name'] = '关键词';
$LANG['link_address'] = '联接';
?>
|
108wo
|
phpcms/languages/zh-cn/keylink.lang.php
|
PHP
|
asf20
| 137
|
<?php
/*Language Format:
Add a new file(.lang.php) with your module name at /phpcms/languages/
translation save at the array:$LANG
*/
$LANG['poster'] = '广告';
$LANG['setting_updates_successful'] = '配置更新完成!';
$LANG['name_plates_not_empty'] = '版位名称不能为空';
$LANG['plate_width_not_empty'] = '版位的宽度不能为空';
$LANG['plate_height_not_empty'] = '版位的宽度不能为空';
$LANG['added_successful'] = '版位添加成功';
$LANG['edited_successful'] = '版位修改成功';
$LANG['boardtype'] = '版位名称';
$LANG['size_format'] = '版位尺寸';
$LANG['plate_width'] = '宽:';
$LANG['plate_height'] = '高:';
$LANG['ad_list'] = '广告列表';
$LANG['random_one'] = '随机列出一个';
$LANG['random_all'] = '全部列出';
$LANG['description'] = '版位描述';
$LANG['js_path'] = 'JS路径';
$LANG['ads_num'] = '广告数';
$LANG['banner'] = '矩形横幅';
$LANG['fixure'] = '固定位置';
$LANG['float'] = '漂浮移动';
$LANG['couplet'] = '对联广告';
$LANG['imagechange'] = '图片轮换广告';
$LANG['imagelist'] = '图片列表广告';
$LANG['text'] = '文字广告';
$LANG['code'] = '代码调用';
$LANG['position'] = '版位位置';
$LANG['left_margin'] = '左边距';
$LANG['top_margin'] = '上边距';
$LANG['lightbox'] = '全屏居中';
$LANG['rolling'] = '随屏滚动';
$LANG['ads_type'] = '版位类型';
$LANG['remove_all_selected'] = '删除选定的版位';
$LANG['poster_title'] = '广告标题';
$LANG['for_postion'] = '所属版位';
$LANG['poster_type'] = '广告类型';
$LANG['line_time'] = '上线时间';
$LANG['down_time'] = '下线时间';
$LANG['photo_setting'] = '图片设置';
$LANG['linkurl'] = '链接地址';
$LANG['flash_url'] = '动画地址';
$LANG['upload_photo'] = '图片上传';
$LANG['flash_setting'] = '动画设置';
$LANG['alt'] = '文字提示';
$LANG['flash_upload'] = '动画上传';
$LANG['word_link'] = '文字链接';
$LANG['code_setting'] = '代码设置';
$LANG['word_content'] = '文字内容';
$LANG['code_content'] = '代码内容';
$LANG['add_space'] = '添加版位';
$LANG['flash'] = '动画';
$LANG['photo'] = '图片';
$LANG['title'] = '文字';
$LANG['add_ads'] = '添加广告';
$LANG['add_ads_success'] = '广告添加成功!';
$LANG['no_create_js'] = '没有版位ID,不能生成js';
$LANG['space_exist'] = '版位已存在';
$LANG['adsname_no_empty'] = '广告名称不能为空';
$LANG['no_ads_type'] = '广告类型没有选择';
$LANG['no_setting_photo'] = '没有设置图片';
$LANG['no_flash_path'] = '没有设置动画路径';
$LANG['no_title_info'] = '没有设置文字信息';
$LANG['please_input_name'] = '请输入广告名称!';
$LANG['name_three_length'] = '广告名称至少3个汉字以上';
$LANG['correct'] = '输入正确!';
$LANG['server_busy'] = '服务器没有返回数据,可能服务器忙,请重试';
$LANG['ads_exist'] = '该广告已存在';
$LANG['checking'] = '正进行合法性校验...';
$LANG['choose_ads_type'] = '请选择广告类型';
$LANG['type_selected'] = '必须类型选择';
$LANG['online_time'] = '请选择上线时间';
$LANG['one_month_no_select'] = '默认为一个月';
$LANG['down_time'] = '请选择下线时间';
$LANG['link_content'] = '输入文字链接内容';
$LANG['no_link_content'] = '没有输入内容!';
$LANG['input_code'] = '输入代码';
$LANG['space_list'] = '版位列表';
$LANG['status'] = '状态';
$LANG['hits'] = '点击数';
$LANG['addtime'] = '添加时间';
$LANG['stop'] = '停用';
$LANG['past'] = '过期';
$LANG['start'] = '启用';
$LANG['stat'] = '统计';
$LANG['edit_ads'] = '编辑广告';
$LANG['ads_module'] = '广告模块';
//广告统计
$LANG['hits_stat'] = '点击统计';
$LANG['show_stat'] = '展示统计';
$LANG['listorder_f_area'] = '按地区排序';
$LANG['listorder_f_ip'] = '按IP排序';
$LANG['all'] = '全部';
$LANG['today'] = '今日';
$LANG['yesterday'] = '昨日';
$LANG['one_week'] = '一周';
$LANG['two_week'] = '两周';
$LANG['one_month'] = '一月';
$LANG['history_select'] = '历史数据查询';
$LANG['browse_ip'] = '浏览IP';
$LANG['for_area'] = '所属地域';
$LANG['show_times'] = '展示次数';
$LANG['come_from'] = '来源';
$LANG['visit_time'] = '访问时间';
$LANG['operate'] = '操作';
$LANG['click'] = '点击';
$LANG['show'] = '展示';
//setting
$LANG['ads_setting'] = '广告模块配置';
$LANG['ads_show_time'] = '统计广告展示次数?';
$LANG['upload_file_ext'] = '上传文件类型';
$LANG['file_size'] = '文件大小';
//space_add\space_edit
$LANG['please_input_space_name'] = '请输入版位名称!';
$LANG['spacename_three_length'] = '版位名称至少3个汉字以上';
$LANG['spacename_illegality'] = '你输入的版位名称非法,请确认';
$LANG['space_exist'] = '该版位已存在,请更换版位名';
$LANG['choose_space_type'] = '选择版位类型';
$LANG['input_width_height'] = '输入宽度、高度';
$LANG['three_numeric'] = '3位以下数字';
$LANG['get_code_space'] = '广告版位调用';
//调用代码
$LANG['explain'] = '调用说明';
$LANG['notice'] = '1、调用方式一对服务器环境无特殊要求,可统计广告展示次数和自动判断广告是否过期,但是消耗服务器资源,访问速度慢,不支持Google等JS类代码广告;<br />
2、调用方式二对服务器环境无特殊要求,消耗服务器资源少,访问速度快,但是不能自动判断广告有效期,要时常更新js。不支持Google等JS类代码广告;<br />
3、调用google、baidu等代码广告,只能使用唯一的一种方式。当网站使用静态页面时,修改广告代码后请更新广告所在的静态页;<br />
4、根据自身情况选择一种调用方式,然后把调用代码复制粘贴到需要显示广告的模板再更新相关网页即可。';
$LANG['one_way'] = '调用方式一';
$LANG['js_code'] = 'JS调用代码(PHP动态调用)';
$LANG['this_way_stat_show'] = '此方式可以统计展示次数。';
$LANG['copy_code'] = '复制代码至剪贴板';
$LANG['second_code'] = '调用方式二';
$LANG['js_code_html'] = 'JS调用代码(JS静态调用)';
//space_list
$LANG['preview'] = '预览';
$LANG['get_code'] = '调用代码';
$LANG['edit_space'] = '编辑版位';
$LANG['module_setting'] = '模块配置';
$LANG['update_js_success'] = '更新js完成!';
$LANG['update_js'] = '更新js完成';
//模板设置
$LANG['template_name'] = '模板名称';
$LANG['setting_success'] = '设置完成!';
$LANG['check_template'] = '查看';
$LANG['setting_template'] = '设置';
$LANG['template_file_name'] = '模板文件名';
$LANG['name_cn'] = '中文名';
$LANG['show_this_param'] = '是否出现以下属性';
$LANG['this_param_selected'] = '上述属性是否被选中';
$LANG['is_set_space'] = '是否设置版位位置';
$LANG['is_set_size'] = '是否设置版位尺寸';
$LANG['space_poster'] = '版位下的广告';
$LANG['all_list'] = '全部列出';
$LANG['only_one'] = '按排序列出一个';
$LANG['is_used_type'] = '可用广告类型';
$LANG['max_add_param'] = '一次最多添加的图片等元素数量';
?>
|
108wo
|
phpcms/languages/zh-cn/poster.lang.php
|
PHP
|
asf20
| 7,907
|
<?php
/*Language Format:
Add a new file(.lang.php) with your module name at /phpcms/languages/
translation save at the array:$LANG
*/
$LANG['wap_del_cofirm'] = '确认删除?';
$LANG['phpcms_friends'] = '手机网友';
$LANG['confirm_delete'] = '确认删除选择的分类吗?';
$LANG['wap_add_site'] = '添加手机站点';
$LANG['parameter_error'] = '参数错误';
$LANG['wap_add_site'] = '添加手机站点';
$LANG['wap_del_succ'] = '删除成功';
$LANG['wap_change_status'] = '更新状态成功';
$LANG['wap_add_samesite_error'] = '请勿重复添加相同站点';
$LANG['wap_empty_type'] = '分类名称为空';
$LANG['wap_empty_bound_type'] = '绑定栏目为空';
$LANG['wap_repeat_bound_error'] = '该栏目已绑定过,无法重复绑定';
$LANG['wap_add_subtype'] = '+添加子分类';
$LANG['wap_repeat_bound'] = '栏目绑定重复';
$LANG['wap_type_del_error'] = '该分类含有子栏目,请先删除其子栏目';
$LANG['wap_permission_denied_del'] = '无权限删除该站点';
$LANG['basic_config'] = '基本设置';
$LANG['parameter_config'] = '参数设置';
$LANG['wap_sel_site'] = '选择要开启的站点:';
$LANG['wap_belong_site'] = '所属站点:';
$LANG['wap_sitename'] = '站点名称:';
$LANG['wap_logo'] = '手机门户站点LOGO:';
$LANG['wap_domain'] = '绑定域名';
$LANG['wap_listnum'] = '列表页条数:';
$LANG['wap_thumb'] = '缩略图尺寸:';
$LANG['wap_content_page'] = '内容页分页字节数:';
$LANG['wap_index_tpl'] = '首页模板:';
$LANG['wap_cat_tpl'] = '频道页模板:';
$LANG['wap_list_tpl'] = '列表页模板:';
$LANG['wap_show_tpl'] = '内容页模板:';
$LANG['wap_hotword'] = '热词';
$LANG['wap_open'] = '开启';
$LANG['wap_close'] = '关闭';
$LANG['wap_type_manage'] = '分类管理';
$LANG['wap_type_name'] = '分类名称 ';
$LANG['wap_toptype_add'] = '添加顶级分类';
$LANG['wap_type_bound'] = '选择要绑定的栏目';
$LANG['wap_bound_type'] = '绑定栏目';
$LANG['wap_guestbook'] = '发表留言成功!页面正在返回……';
$LANG['wap_goback'] = '返回正文页';
$LANG['wap_close_status'] = '您访问的站点不存在或者未开启wap访问';
$LANG['wap_hotword_desc'] = '如"phpcms|http://wap.phpcms.cn"多个热词以换行分割。';
?>
|
108wo
|
phpcms/languages/zh-cn/wap.lang.php
|
PHP
|
asf20
| 2,320
|
<?php
$LANG['name'] = '名称';
$LANG['not_have_permissions'] = '您没有权限进行此项操作。';
$LANG['block_configuration'] = '碎片配置';
$LANG['display_position'] = '显示位置';
$LANG['code'] = '代码型';
$LANG['table_style'] = '格式化数据型';
$LANG['permission_configuration'] = '权限配置';
$LANG['role'] = '角色';
$LANG['updates'] = '更新内容';
$LANG['block_data'] = '碎片数据';
$LANG['title'] = '标题';
$LANG['link'] = '链接';
$LANG['thumb'] = '缩略图';
$LANG['attachment_upload'] = '附件上传';
$LANG['pic_upload'] = '上传图片';
$LANG['delete_image'] = '删除图片';
$LANG['desc'] = '简介';
$LANG['up'] = '向上';
$LANG['down'] = '向下';
$LANG['preview'] = '预览';
$LANG['history'] = '历史记录';
$LANG['datatable'] = '添加行';
$LANG['pieces_template'] = '碎片模板';
$LANG['insert'] = '点击插入';
$LANG['time'] = '时间';
$LANG['admin'] = '操作人';
$LANG['restore'] = '还原';
$LANG['are_you_sure_you_want_to_delete'] = '您确定要删除吗?';
$LANG['search_content'] = '搜索文章';
$LANG['end_of_time_to_time_to_less_than'] = '结束时间不能小于开始时间';
$LANG['please_set_the_starting_time'] = '请设置开始时间';
$LANG['category'] = '栏目';
$LANG['posterize_time'] = '发布时间';
$LANG['recommend'] = '推荐';
$LANG['not_recommend'] = '不推荐';
$LANG['all'] = '全部';
$LANG['search_mode'] = '搜索方式';
$LANG['key_word'] = '关键词';
$LANG['insert_a_comment_about_the_selected_text'] = '插入选中';
$LANG['pic'] = '图';
$LANG['folded_up_in_search_of'] = '收起/展开 搜索项';
$LANG['link_visualization_not_exists'] = '该菜单为外部链接分类,不需要可视化';
|
108wo
|
phpcms/languages/zh-cn/block.lang.php
|
PHP
|
asf20
| 1,750
|
<?php
/*Language Format:
Add a new file(.lang.php) with your module name at /phpcms/languages/
translation save at the array:$LANG
*/
//info_setting.phpcredits
$LANG['addmark'] = '点击标注位置';
$LANG['editmark'] = '修改标注位置';
$LANG['mapmark'] = '地图标注';
$LANG['api_addmark'] = '添加标注';
$LANG['api_resetmap'] = '重置地图';
$LANG['api_changecity'] = '更换城市';
$LANG['api_citylist'] = '城市列表';
$LANG['api_inputcity'] = '输入城市名';
$LANG['api_citysear_submit'] = '确定';
?>
|
108wo
|
phpcms/languages/zh-cn/map.lang.php
|
PHP
|
asf20
| 545
|
<?php
/**
* 获取联动菜单接口
*/
defined('IN_PHPCMS') or exit('No permission resources.');
if(!$_GET['callback'] || !$_GET['act']) showmessage(L('error'));
switch($_GET['act']) {
case 'ajax_getlist':
ajax_getlist();
break;
case 'ajax_getpath':
ajax_getpath($_GET['parentid'],$_GET['keyid'],$_GET['callback']);
break;
case 'ajax_gettopparent':
ajax_gettopparent($_GET['linkageid'],$_GET['keyid'],$_GET['callback']);
break;
}
/**
* 获取地区列表
*/
function ajax_getlist() {
$keyid = intval($_GET['keyid']);
$datas = getcache($keyid,'linkage');
$infos = $datas['data'];
$where_id = isset($_GET['parentid']) ? $_GET['parentid'] : intval($infos[$_GET['linkageid']]['parentid']);
$parent_menu_name = ($where_id==0) ? $datas['title'] :$infos[$where_id]['name'];
foreach($infos AS $k=>$v) {
if($v['parentid'] == $where_id) {
$s[]=iconv(CHARSET,'utf-8',$v['linkageid'].','.$v['name'].','.$v['parentid'].','.$parent_menu_name);
}
}
if(count($s)>0) {
$jsonstr = json_encode($s);
echo trim_script($_GET['callback']).'(',$jsonstr,')';
exit;
} else {
echo trim_script($_GET['callback']).'()';exit;
}
}
/**
* 获取地区父级路径路径
* @param $parentid 父级ID
* @param $keyid 菜单keyid
* @param $callback json生成callback变量
* @param $result 递归返回结果数组
* @param $infos
*/
function ajax_getpath($parentid,$keyid,$callback,$result = array(),$infos = array()) {
$keyid = intval($keyid);
$parentid = intval($parentid);
if(!$infos) {
$datas = getcache($keyid,'linkage');
$infos = $datas['data'];
}
if(array_key_exists($parentid,$infos)) {
$result[]=iconv(CHARSET,'utf-8',$infos[$parentid]['name']);
return ajax_getpath($infos[$parentid]['parentid'],$keyid,$callback,$result,$infos);
} else {
if(count($result)>0) {
krsort($result);
$jsonstr = json_encode($result);
echo trim_script($callback).'(',$jsonstr,')';
exit;
} else {
$result[]=iconv(CHARSET,'utf-8',$datas['title']);
$jsonstr = json_encode($result);
echo trim_script($callback).'(',$jsonstr,')';
exit;
}
}
}
/**
* 获取地区顶级ID
* Enter description here ...
* @param $linkageid 菜单id
* @param $keyid 菜单keyid
* @param $callback json生成callback变量
* @param $infos 递归返回结果数组
*/
function ajax_gettopparent($linkageid,$keyid,$callback,$infos = array()) {
$keyid = intval($keyid);
$linkageid = intval($linkageid);
if(!$infos) {
$datas = getcache($keyid,'linkage');
$infos = $datas['data'];
}
if($infos[$linkageid]['parentid']!=0) {
return ajax_gettopparent($infos[$linkageid]['parentid'],$keyid,$callback,$infos);
} else {
echo trim_script($callback).'(',$linkageid,')';
exit;
}
}
?>
|
108wo
|
api/get_linkage.php
|
PHP
|
asf20
| 2,836
|
<?php
defined('IN_PHPCMS') or exit('No permission resources.');
$txt = trim($_GET['txt']);
if(extension_loaded('gd') && $txt ) {
header ("Content-type: image/png");
$txt = urldecode(sys_auth($txt, 'DECODE'));
$fontsize = isset($_GET['fontsize']) ? intval($_GET['fontsize']) : 16;
$fontpath = PC_PATH.'libs'.DIRECTORY_SEPARATOR.'data'.DIRECTORY_SEPARATOR.'font'.DIRECTORY_SEPARATOR;
$fontfile = isset($_GET['font']) && !empty($_GET['font']) ? $fontpath.trim($_GET['font']) : $fontpath.'georgia.ttf';
$fontcolor = isset($_GET['fontcolor']) && !empty($_GET['fontcolor']) ? trim($_GET['fontcolor']) : 'FF0000';
$fontcolor_r = hexdec(substr($fontcolor,0,2));
$fontcolor_g = hexdec(substr($fontcolor,2,2));
$fontcolor_b = hexdec(substr($fontcolor,4,2));
if(file_exists($fontfile)){
//计算文本写入后的宽度,右下角 X 位置-左下角 X 位置
$image_info = imagettfbbox($fontsize,0,$fontfile,$txt);
$imageX = $image_info[2]-$image_info[0]+10;
$imageY = $image_info[1]-$image_info[7]+5;
//print_r($image_info);
$im = @imagecreatetruecolor ($imageX, $imageY) or die ("Cannot Initialize new GD image stream");
$white= imagecolorallocate($im, 255, 255, 255);
$font_color= imagecolorallocate($im,$fontcolor_r,$fontcolor_g,$fontcolor_b);
imagecolortransparent($im,$white); //背景透明
imagefilledrectangle($im, 0, 0, $imageX, $imageY, $white);
$txt = iconv(CHARSET,"UTF-8",$txt);
imagettftext($im, $fontsize, 0, 5, $imageY-5, $font_color, $fontfile, $txt);
} else {
$imageX = strlen($txt)*9;
$im = @imagecreate ($imageX, 16) or die ("Cannot Initialize new GD image stream");
$bgColor = ImageColorAllocate($im,255,255,255);
$white=imagecolorallocate($im,234,185,95);
$font_color=imagecolorallocate($im,$fontcolor_r,$fontcolor_g,$fontcolor_b);
$fonttype = intval($_GET['fonttype']);
imagestring ($im, $fonttype, 0, 0,$txt, $font_color);
}
imagepng ($im);
imagedestroy ($im);
}
?>
|
108wo
|
api/creatimg.php
|
PHP
|
asf20
| 1,985
|
<?php
/**
* 获取关键字接口
*/
defined('IN_PHPCMS') or exit('No permission resources.');
define('API_URL_GET_KEYWORDS', 'http://tool.phpcms.cn/api/get_keywords.php');
$number = intval($_GET['number']);
$data = $_POST['data'];
echo get_keywords($data, $number);
function get_keywords($data, $number = 3) {
$data = trim(strip_tags($data));
if(empty($data)) return '';
$http = pc_base::load_sys_class('http');
if(CHARSET != 'utf-8') {
$data = iconv('utf-8', CHARSET, $data);
} else {
$data = iconv('utf-8', 'gbk', $data);
}
$http->post(API_URL_GET_KEYWORDS, array('siteurl'=>SITE_URL, 'charset'=>CHARSET, 'data'=>$data, 'number'=>$number));
if($http->is_ok()) {
if(CHARSET != 'utf-8') {
return $http->get_data();
} else {
return iconv('gbk', 'utf-8', $http->get_data());
}
}
return '';
}
?>
|
108wo
|
api/get_keywords.php
|
PHP
|
asf20
| 859
|
<?php
defined('IN_PHPCMS') or exit('No permission resources.');
$field = trim($_GET['field']);
$modelid = intval($_GET['modelid']);
$data = getcache('model_field_'.$modelid,'model');
$setting = string2array($data[$field]['setting']);
$key = $_GET['api_key'] ? $_GET['api_key'] : $setting['api_key'];
$maptype = $_GET['maptype'] ? intval($_GET['maptype']) : ($setting['maptype'] ? $setting['maptype'] : 1);
$defaultcity = $_GET['defaultcity'] ? $_GET['defaultcity'] : ($setting['defaultcity'] ? $setting['defaultcity'] : '北京');
$hotcitys = explode(",",$setting['hotcitys']);
if(!isset($_GET['city'])) {
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"<?php if(isset($addbg)) { ?> class="addbg"<?php } ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET;?>">
<?php if($maptype == 1) {?>
<script src="http://app.mapabc.com/apis?&t=flashmap&v=2.4&key=<?php echo $key?>&hl=zh-CN" type="text/javascript"></script>
<?php } elseif($maptype == 2) {?>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.2&key=<?php echo $key?>"></script></script>
<?php }?>
<script type="text/javascript" src="<?php echo JS_PATH ?>jquery.min.js"></script>
<style type="text/css">
*{ padding:0; margin:0}
body{font-size: 12px;}
#toolbar{ background-color:#E5ECF9;zoom:1; height:24px; line-height:24px; padding:0 12px; margin-top:3px; position:relative}
#toolbar a{display:inline-block;zoom:1;*display:inline; color:#4673CC}
#toolbar a.mark,#toolbar a.map{ background: url(<?php echo IMG_PATH ?>icon/map_mark.png) no-repeat left 50%; padding:0 0 0 20px}
#toolbar a.map{ background-image:url(<?php echo IMG_PATH ?>icon/map.png); margin-left:12px}
#toolbar .right{ float:right;}
#toolbar .CityBox{position:absolute; left:40px; top:30px; background-color:#fff; border:1px solid #8BA4D8; padding:2px; z-index:1; width:200px; display:none}
#toolbar .CityBox h4{background-color:#E5ECF9; line-height:20px; height:20px; padding:0 6px; color:#6688CC; position:relative}
#toolbar .CityBox h4 div.top{background: url(<?php echo IMG_PATH ?>topo.png) no-repeat; height:6px; width:11px; position:absolute; top:-9px; left:38px; line-height:normal; font-size:0}
#toolbar .CityBox .content{ padding:6px; height:150px;overflow-y:auto; padding-bottom:8px}
#toolbar .CityBox a.close{background: url(<?php echo IMG_PATH ?>cross.png) no-repeat left 3px; display:block; width:16px; height:16px;position: absolute;outline:none;right:3px; bottom:1px}
#toolbar .CityBox a.close:hover{background-position: left -46px}
#toolbar .CityBox .line{ height:6px; border-bottom:1px solid #EBEBEB; margin-bottom:5px;}
#mapObj{width:699px;height:388px; padding-top:1px}
</style>
</head>
<body>
<div id="toolbar">
<div class="selCity">
<div class="right"><a href="javascript:;" class="mark" onClick="addMarker();"><?php echo L('api_addmark','','map')?></a><a href="javascript:;" onClick="removeMarker();" class="map"><?php echo L('api_resetmap','','map')?></a></div>
<strong id="curCity"><?php echo $defaultcity?></strong> [<a onClick="mapClose();" id="curCityText" href="javascript:;"><?php echo L('api_changecity','','map')?></a>]
</div>
<div class="CityBox">
<h4><?php echo L('api_citylist','','map')?><div class="top"></div><a href="javascript:;" class="close" onClick="mapClose();"></a></h4>
<div class="content">
<p>
<?php foreach($hotcitys as $n=>$city) {?>
<a href="javascript:;" onClick="keywordSearch('<?php echo trim($city)?>')"><?php echo $city?></a>
<?php } ?>
</p>
<div class="line"></div>
<input type="text" value="<?php echo L('api_inputcity','','map')?>" style=" width:140px; height:18px" name="citywd" id="citywd" onclick="$(this).val('');">
<input type="submit" value="<?php echo L('api_citysear_submit','','map')?>" class="city_submit" onClick="keywordSearch()">
</div>
</div>
</div>
<div id="mapObj" class="view"></div>
<?php if($maptype == 1) {?>
<SCRIPT LANGUAGE="JavaScript">
//设置中心点为北京
//设置地图初始化参数对象
var mapOptions = new MMapOptions();
var defaultcity = "<?php echo strtolower(CHARSET)!='utf-8' ? iconv(CHARSET,'UTF-8',$defaultcity) : $defaultcity?>";
mapOptions.toolbar = MConstants.MINI;
mapOptions.scale = new MPoint(20,20);
mapOptions.zoom = 10;
mapOptions.overviewMap = MConstants.SHOW;
mapOptions.scale = MConstants.SHOW;
mapOptions.mapComButton = MConstants.SHOW_NO
//创建地图对象
var mapObj = new MMap("mapObj", mapOptions);
var maptools = new MMapTools(mapObj);
maptools.setCenterByCity(defaultcity);
if(window.top.$('#<?php echo $field?>').val()) {
drawPoints();
}
//设置切换城市
function keywordSearch(city) {
if(city==null || city=='') {
var city=$("#citywd").val();
}
var cn_city = city;
var city = encodeURI(city);
var url = "api.php?op=map&city="+city;
$.get(url,function(data){
if(data) {
maptools.setCenterByCity(data);
mapObj.setZoomLevel(10);
$("#curCity").html(cn_city);
}
})
}
function addMarker(){
var address = $(window.parent.document).find("input[id='address']").val();
var tipOption=new MTipOptions();//添加信息窗口
tipOption.tipType = MConstants.HTML_BUBBLE_TIP;//信息窗口标题
tipOption.title = address;//信息窗口标题
tipOption.content = address;//信息窗口内容
var markerOption = new MMarkerOptions();
markerOption.imageUrl='<?php echo IMG_PATH ?>icon/mak.png';
markerOption.picAgent=false;
markerOption.imageAlign=MConstants.BOTTOM_CENTER;
markerOption.isBounce=false;
markerOption.isEditable=true;
markerOption.tipOption = tipOption;
markerOption.canShowTip= address ? true : false;
markerOption.rotation="0";
markerOption.dimorphicColor="0x00A0FF";
var center = mapObj.getCenter();
var ZoomLevel = mapObj.getZoomLevel();
Mmarker = new MMarker(new MLngLat(center.lngX,center.latY),markerOption);
Mmarker.id="mark101";
mapObj.addOverlay(Mmarker,true) ;
mapObj.addEventListener(mapObj,MConstants.MOUSE_UP,mouseUp);
window.top.$('#<?php echo $field?>').val(center.lngX+'|'+center.latY+'|'+ZoomLevel);
}
function removeMarker() {
mapObj.removeAllOverlays();
maptools.setCenterByCity(defaultcity);
$("#curCity").html('<?php echo $defaultcity?>');
mapOptions.zoom = 10;
window.top.$('#<?php echo $field?>').val('');
}
function mouseUp(param){
var object=mapObj.getOverlayById('mark101');
var lngX = object.lnglat.lngX;
var latY = object.lnglat.latY;
var ZoomLevel = mapObj.getZoomLevel();
window.top.$('#<?php echo $field?>').val(lngX+'|'+latY+'|'+ZoomLevel);
}
function mapClose(){
var CityBox=$(".CityBox");
if(CityBox.css('display')=='none'){
CityBox.show();
}else{
CityBox.hide();
}
}
function drawPoints(){
var data = window.top.$('#<?php echo $field?>').val();
var data = data.split('|');
var lngX = data[0];
var latY = data[1];
var zoom = data[2]? data[2] : 10
mapObj.setZoomAndCenter(zoom,new MLngLat(lngX,latY));
var markerOption = new MMarkerOptions();
var tipOption=new MTipOptions();//添加信息窗口
var address = "";
tipOption.tipType = MConstants.HTML_BUBBLE_TIP;//信息窗口标题
tipOption.title = address;//信息窗口标题
tipOption.content = address;//信息窗口内容
var markerOption = new MMarkerOptions();
markerOption.imageUrl="<?php echo IMG_PATH ?>icon/mak.png";
markerOption.picAgent=false;
markerOption.isEditable=true;
markerOption.imageAlign=MConstants.BOTTOM_CENTER;
markerOption.tipOption = tipOption;
markerOption.canShowTip= address ? true : false;
markerOption.dimorphicColor="0x00A0FF";
Mmarker = new MMarker(new MLngLat(lngX,latY),markerOption);
Mmarker.id="mark101";
mapObj.addOverlay(Mmarker,true);
mapObj.addEventListener(mapObj,MConstants.MOUSE_UP,mouseUp);
}
</script>
<style>
.MFMP_pngImg0{ left:0; bottom:0; display:none}
</style>
<?php } elseif($maptype == 2) {?>
<script type="text/javascript">
var mapObj = new BMap.Map("mapObj"); // 创建地图实例
//向地图中添加缩放控件
var ctrl_nav = new BMap.NavigationControl({anchor:BMAP_ANCHOR_TOP_LEFT,type:BMAP_NAVIGATION_CONTROL_LARGE});
mapObj.addControl(ctrl_nav);
mapObj.enableDragging();//启用地图拖拽事件,默认启用(可不写)
mapObj.enableScrollWheelZoom();//启用地图滚轮放大缩小
mapObj.enableDoubleClickZoom();//启用鼠标双击放大,默认启用(可不写)
mapObj.enableKeyboard();//启用键盘上下左右键移动地图
//mapObj.centerAndZoom("<?php echo $defaultcity?>");
if(window.top.$('#<?php echo $field?>').val()) {
drawPoints();
} else {
mapObj.centerAndZoom("<?php echo $defaultcity?>");
}
//设置切换城市
function keywordSearch(city) {
if(city==null || city=='') {
var city=$("#citywd").val();
}
mapObj.setCenter(city);
$("#curCity").html(city);
}
function drawPoints(){
var data = window.top.$('#<?php echo $field?>').val();
var data = data.split('|');
var lngX = data[0];
var latY = data[1];
var zoom = data[2] ? data[2] : 10;
mapObj.centerAndZoom(new BMap.Point(lngX,latY),zoom);
// 创建图标对象
var myIcon = new BMap.Icon('<?php echo IMG_PATH ?>icon/mak.png', new BMap.Size(27, 45));
// 创建标注对象并添加到地图
var center = mapObj.getCenter();
var point = new BMap.Point(lngX,latY);
var marker = new BMap.Marker(point, {icon: myIcon});
marker.enableDragging();
mapObj.addOverlay(marker);
var ZoomLevel = mapObj.getZoom();
marker.addEventListener("dragend", function(e){
window.top.$('#<?php echo $field?>').val(e.point.lng+'|'+e.point.lat+'|'+ZoomLevel);
})
}
function addMarker(){
mapObj.clearOverlays();
// 创建图标对象
var myIcon = new BMap.Icon('<?php echo IMG_PATH ?>icon/mak.png', new BMap.Size(27, 45));
// 创建标注对象并添加到地图
var center = mapObj.getCenter();
var point = new BMap.Point(center.lng,center.lat);
var marker = new BMap.Marker(point, {icon: myIcon});
marker.enableDragging();
mapObj.addOverlay(marker);
var ZoomLevel = mapObj.getZoom();
window.top.$('#<?php echo $field?>').val(center.lng+'|'+center.lat+'|'+ZoomLevel);
marker.addEventListener("dragend", function(e){
window.top.$('#<?php echo $field?>').val(e.point.lng+'|'+e.point.lat+'|'+ZoomLevel);
})
}
function mapClose(){
var CityBox=$(".CityBox");
if(CityBox.css('display')=='none'){
CityBox.show();
}else{
CityBox.hide();
}
}
function removeMarker() {
mapObj.clearOverlays();
mapObj.centerAndZoom("<?php echo $defaultcity?>");
$("#curCity").html('<?php echo $defaultcity?>');
window.top.$('#<?php echo $field?>').val('');
}
</script>
<?php }?>
</body>
</html>
<?php
} elseif(!empty($_GET['city']) && $maptype==1) {
if(!$_GET['city']) showmessage(L('error'));
$city = urldecode(trim($_GET['city']));
echo $city;
}
?>
|
108wo
|
api/map.php
|
PHP
|
asf20
| 11,324
|
<?php
defined('IN_PHPCMS') or exit('No permission resources.');
/**
* 点击统计
*/
$db = '';
$db = pc_base::load_model('hits_model');
if($_GET['modelid'] && $_GET['id']) {
$model_arr = array();
$model_arr = getcache('model','commons');
$modelid = intval($_GET['modelid']);
$hitsid = 'c-'.$modelid.'-'.intval($_GET['id']);
$r = get_count($hitsid);
if(!$r) exit;
extract($r);
hits($hitsid);
echo "\$('#todaydowns').html('$dayviews');";
echo "\$('#weekdowns').html('$weekviews');";
echo "\$('#monthdowns').html('$monthviews');";
} elseif($_GET['module'] && $_GET['id']) {
$module = $_GET['module'];
if((preg_match('/([^a-z0-9_\-]+)/i',$module))) exit('1');
$hitsid = $module.'-'.intval($_GET['id']);
$r = get_count($hitsid);
if(!$r) exit;
extract($r);
hits($hitsid);
}
/**
* 获取点击数量
* @param $hitsid
*/
function get_count($hitsid) {
global $db;
$r = $db->get_one(array('hitsid'=>$hitsid));
if(!$r) return false;
return $r;
}
/**
* 点击次数统计
* @param $contentid
*/
function hits($hitsid) {
global $db;
$r = $db->get_one(array('hitsid'=>$hitsid));
if(!$r) return false;
$views = $r['views'] + 1;
$yesterdayviews = (date('Ymd', $r['updatetime']) == date('Ymd', strtotime('-1 day'))) ? $r['dayviews'] : $r['yesterdayviews'];
$dayviews = (date('Ymd', $r['updatetime']) == date('Ymd', SYS_TIME)) ? ($r['dayviews'] + 1) : 1;
$weekviews = (date('YW', $r['updatetime']) == date('YW', SYS_TIME)) ? ($r['weekviews'] + 1) : 1;
$monthviews = (date('Ym', $r['updatetime']) == date('Ym', SYS_TIME)) ? ($r['monthviews'] + 1) : 1;
$sql = array('views'=>$views,'yesterdayviews'=>$yesterdayviews,'dayviews'=>$dayviews,'weekviews'=>$weekviews,'monthviews'=>$monthviews,'updatetime'=>SYS_TIME);
return $db->update($sql, array('hitsid'=>$hitsid));
}
?>
$('#hits').html('<?php echo $views?>');
|
108wo
|
api/count.php
|
PHP
|
asf20
| 1,928
|
<?php
defined('IN_PHPCMS') or exit('No permission resources.');
$session_storage = 'session_'.pc_base::load_config('system','session_storage');
pc_base::load_sys_class($session_storage);
$checkcode = pc_base::load_sys_class('checkcode');
if (isset($_GET['code_len']) && intval($_GET['code_len'])) $checkcode->code_len = intval($_GET['code_len']);
if ($checkcode->code_len > 8 || $checkcode->code_len < 2) {
$checkcode->code_len = 4;
}
if (isset($_GET['font_size']) && intval($_GET['font_size'])) $checkcode->font_size = intval($_GET['font_size']);
if (isset($_GET['width']) && intval($_GET['width'])) $checkcode->width = intval($_GET['width']);
if ($checkcode->width <= 0) {
$checkcode->width = 130;
}
if (isset($_GET['height']) && intval($_GET['height'])) $checkcode->height = intval($_GET['height']);
if ($checkcode->height <= 0) {
$checkcode->height = 50;
}
if (isset($_GET['font_color']) && trim(urldecode($_GET['font_color'])) && preg_match('/(^#[a-z0-9]{6}$)/im', trim(urldecode($_GET['font_color'])))) $checkcode->font_color = trim(urldecode($_GET['font_color']));
if (isset($_GET['background']) && trim(urldecode($_GET['background'])) && preg_match('/(^#[a-z0-9]{6}$)/im', trim(urldecode($_GET['background'])))) $checkcode->background = trim(urldecode($_GET['background']));
$checkcode->doimage();
$_SESSION['code']=$checkcode->get_code();
|
108wo
|
api/checkcode.php
|
PHP
|
asf20
| 1,374
|
<?php
/*
* 客户端被动接收phpsso服务端通知
* 服务端通知内容:同步登陆、退出,同步积分设置、对换比率,同步添加、删除用户、修改用户密码,测试通信状态
*
*/
defined('IN_PHPCMS') or exit('No permission resources.');
$db = pc_base::load_model('member_model');
$system = pc_base::load_config('system');
define('APPID', $system['phpsso_appid']);
$ps_api_url = $system['phpsso_api_url']; //接口地址
$ps_auth_key = $system['phpsso_auth_key']; //加密密钥
$ps_version = $system['phpsso_version'];
pc_base::load_app_class('client', 'member', 0);
$client = new client($ps_api_url, $ps_auth_key);
$code = $_REQUEST['code'];
parse_str($client->sys_auth($code, 'DECODE'), $arr);
if(isset($arr['action'])) {
$action = $arr['action'];
} else {
exit('0');
}
/**
* 测试通信状态
*/
if ($action == 'check_status') exit('1');
/**
* 添加用户
*/
if ($action == 'member_add') {
$userinfo = array();
$userinfo['phpssouid'] = isset($arr['uid']) ? $arr['uid'] : exit('0');
$userinfo['encrypt'] = isset($arr['random']) ? $arr['random'] : exit('0');
$userinfo['username'] = isset($arr['username']) ? $arr['username'] : exit('0');
$userinfo['password'] = isset($arr['password']) ? $arr['password'] : exit('0');
$userinfo['email'] = isset($arr['email']) ? $arr['email'] : '';
$userinfo['regip'] = isset($arr['regip']) ? $arr['regip'] : '';
$userinfo['regdate'] = $userinfo['lastdate'] = SYS_TIME;
$userinfo['modelid'] = 10;
$userinfo['groupid'] = 6;
$userid = $db->insert($userinfo, 1);
if($userid) {
exit('1');
} else {
exit('0');
}
}
/**
* 删除用户
*/
if ($action == 'member_delete') {
$uidarr = $arr['uids'];
$where = to_sqls($uidarr, '', 'phpssouid');
$status = $db->delete($where);
if($status) {
exit('1');
} else {
exit('0');
}
}
/**
* 编辑用户
*/
if ($action == 'member_edit') {
if(!isset($arr['uid'])) exit('0');
$userinfo = array();
if(isset($arr['password'])) {
$userinfo['password'] = $arr['password'];
$userinfo['encrypt'] = $arr['random'];
}
if(isset($arr['email']) && !empty($arr['email'])) {
$userinfo['email'] = $arr['email'];
}
if(empty($userinfo)) exit('1');
$status = $db->update($userinfo, array('phpssouid'=> $arr['uid']));
if($status) {
exit('1');
} else {
exit('0');
}
}
/**
* 应用积分列表
*/
if ($action == 'credit_list') {
$credit_list = pc_base::load_config('credit');
echo $client->array2string($credit_list);
exit;
}
/**
* 更新积分兑换规则
*/
if ($action == 'credit_update') {
setcache('creditchange', $arr, 'member');
exit('1');
}
/**
* 同步登陆
*/
if ($action == 'synlogin') {
if(!isset($arr['uid'])) exit('0');
$phpssouid = $arr['uid'];
$userinfo = $db->get_one(array('phpssouid'=>$phpssouid));
if (!$userinfo) {
//插入会员
exit;
$ps_userinfo = $client->ps_get_member_info($userid);
$ps_userinfo = unserialize($ps_userinfo);
if ($ps_userinfo['uid'] > 0) {
require_once MOD_ROOT.'api/member_api.class.php';
$member_api = new member_api();
$arr_member['touserid'] = $ps_userinfo['uid'];
$arr_member['registertime'] = TIME;
$arr_member['lastlogintime'] = TIME;
$arr_member['username'] = $ps_userinfo['username'];
$arr_member['password'] = md5(PASSWORD_KEY.$password) ;
$arr_member['email'] = $ps_userinfo['email'];
$arr_member['modelid'] = 10;
$member_api->add($arr_member);
$userid = $member->get_userid($arr['username']);
$userinfo = $member->get($userid);
}
$username = $ps_userinfo['username'];
} else {
$username = $userinfo['username'];
}
//执行本系统登陆操作
$userid = $userinfo['userid'];
$groupid = $userinfo['groupid'];
$username = $userinfo['username'];
$password = $userinfo['password'];
$nickname = $userinfo['nickname'];
$db->update(array('lastip'=>ip(), 'lastdate'=>SYS_TIME), array('userid'=>$userid));
pc_base::load_sys_class('param', '', 0);
if(!$cookietime) $get_cookietime = param::get_cookie('cookietime');
$_cookietime = $cookietime ? intval($cookietime) : ($get_cookietime ? $get_cookietime : 0);
$cookietime = $_cookietime ? TIME + $_cookietime : 0;
$phpcms_auth_key = md5(pc_base::load_config('system', 'auth_key').$_SERVER['HTTP_USER_AGENT']);
$phpcms_auth = sys_auth($userid."\t".$password, 'ENCODE', $phpcms_auth_key);
header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
param::set_cookie('auth', $phpcms_auth, $cookietime);
param::set_cookie('_userid', $userid, $cookietime);
param::set_cookie('_username', $username, $cookietime);
param::set_cookie('_nickname', $nickname, $cookietime);
param::set_cookie('_groupid', $groupid, $cookietime);
param::set_cookie('cookietime', $_cookietime, $cookietime);
exit('1');
}
/**
* 同步退出
*/
if ($action == 'synlogout') {
header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
pc_base::load_sys_class('param', '', 0);
param::set_cookie('auth', '');
param::set_cookie('_userid', '');
param::set_cookie('_username', '');
param::set_cookie('_nickname', '');
param::set_cookie('_groupid', '');
param::set_cookie('cookietime', '');
exit('1');
//执行本系统退出操作
}
?>
|
108wo
|
api/phpsso.php
|
PHP
|
asf20
| 5,633
|
<?php
/**
* 收藏url,必须登录
* @param url 地址,需urlencode,防止乱码产生
* @param title 标题,需urlencode,防止乱码产生
* @return {1:成功;-1:未登录;-2:缺少参数}
*/
defined('IN_PHPCMS') or exit('No permission resources.');
if(empty($_GET['title']) || empty($_GET['url'])) {
exit('-2');
} else {
$title = $_GET['title'];
$title = urldecode($title);
if(CHARSET != 'utf-8') {
$title = iconv('utf-8', CHARSET, $title);
}
$title = htmlspecialchars($title);
$url = safe_replace(urldecode($_GET['url']));
}
//判断是否登录
$phpcms_auth = param::get_cookie('auth');
if($phpcms_auth) {
$auth_key = md5(pc_base::load_config('system', 'auth_key').str_replace('7.0' ,'8.0',$_SERVER['HTTP_USER_AGENT']));
list($userid, $password) = explode("\t", sys_auth($phpcms_auth, 'DECODE', $auth_key));
if($userid >0) {
} else {
exit(trim_script($_GET['callback']).'('.json_encode(array('status'=>-1)).')');
}
} else {
exit(trim_script($_GET['callback']).'('.json_encode(array('status'=>-1)).')');
}
$favorite_db = pc_base::load_model('favorite_model');
$data = array('title'=>$title, 'url'=>$url, 'adddate'=>SYS_TIME, 'userid'=>$userid);
//根据url判断是否已经收藏过。
$is_exists = $favorite_db->get_one(array('url'=>$url, 'userid'=>$userid));
if(!$is_exists) {
$favorite_db->insert($data);
}
exit(trim_script($_GET['callback']).'('.json_encode(array('status'=>1)).')');
?>
|
108wo
|
api/add_favorite.php
|
PHP
|
asf20
| 1,483
|
<?php
/**
* plugin.php 插件入口
*
* @copyright (C) 2005-2010 PHPCMS
* @license http://www.phpcms.cn/license/
* @lastmodify 2011-04-12
*/
define('PHPCMS_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR);
include PHPCMS_PATH.'phpcms/base.php';
$param = pc_base::load_sys_class('param');
pc_base::load_sys_func('plugin');
$cache = '';
if(isset($_GET['id'])) {
list($identification, $filename,$action) = explode('-', $_GET['id']);
$filename = !empty($filename) ? $filename : $identification;
$action = !empty($action) ? $action : 'init';
}
$cache = getcache($identification,'plugins');
if(!$cache['disable'] || !preg_match("/^[a-z0-9_\-]+$/i", $identification) || $filename=='plugin_admin' || $filename=='hook') {
showmessage(L('plugin_not_exist','','plugin'));
} else {
$status = plugin_stat($cache['appid']);
if($status== 0 || $app_status == 1) {
showmessage(L('plugin_developing','','plugin'));
} elseif($status== 3) {
showmessage(L('plugin_be_locked','','plugin'));
}
$iframe = string2array($cache['iframe']);
if($iframe['url']) {
$cache_var = getcache($identification.'_var','plugins');
plugin_base::creat_iframe($cache,$cache_var);
} else {
plugin_base::creat_app($identification, $filename, $action);
}
}
class plugin_base {
/**
* 初始化插件
*/
public static function creat_app($id,$file,$action) {
define('PLUGIN_ID', $id);
define('PLUGIN_FILE', $file);
define('PLUGIN_ACTION', $action);
self::plugin_init();
}
/**
* 调用插件方法
*/
private function plugin_init() {
$controller = self::load_controller();
if (method_exists($controller, PLUGIN_ACTION)) {
if (preg_match('/^[_]/i', PLUGIN_ACTION)) {
exit('Plugin Error:You are visiting the action is to protect the private action');
} else {
call_user_func(array($controller, PLUGIN_ACTION));
}
} else {
exit(L('plugin_error_or_not_exist','','plugin'));
}
}
/**
* 加载插件控制器
* @param string $filename
* @param string $m
* @return obj
*/
private function load_controller($filename = '', $m = '') {
if (empty($filename)) $filename = PLUGIN_FILE;
if (empty($m)) $m = PLUGIN_ID;
$filepath = PC_PATH.'plugin'.DIRECTORY_SEPARATOR.$m.DIRECTORY_SEPARATOR.$filename.'.class.php';
if (file_exists($filepath) && $filename !='plugin_admin') {
$classname = $filename;
include $filepath;
if ($mypath = pc_base::my_path($filepath)) {
$classname = 'MY_'.$filename;
include $mypath;
}
return new $classname;
} else {
exit(L('plugin_error_or_not_exist','','plugin'));
}
}
/**
* 加载插件模板
*/
final public static function plugin_tpl($file, $identification = '') {
$identification = empty($identification) && defined('PLUGIN_ID') ? PLUGIN_ID : $identification;
if(empty($identification)) return false;
return PC_PATH.'plugin'.DIRECTORY_SEPARATOR.$identification.DIRECTORY_SEPARATOR.'templates'.DIRECTORY_SEPARATOR.$file.'.tpl.php';
}
public static function creat_iframe($cache = '',$cache_var = '') {
$iframe = string2array($cache['iframe']);
$width = $cache_var['width'] ? $cache_var['width'] : $iframe['width'];
$height = $cache_var['height'] ? $cache_var['height'] : $iframe['width'];
$url = $iframe['url'];
$SEO = seo(1, 0, $cache['name'], $cache['description'], $cache['name']);
include template('plugin','iframe');
}
}
?>
|
108wo
|
plugin.php
|
PHP
|
asf20
| 3,482
|
<?php
/**
* index.php API 入口
*
* @copyright (C) 2005-2010 PHPCMS
* @license http://www.phpcms.cn/license/
* @lastmodify 2010-7-26
*/
define('PHPCMS_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR);
include PHPCMS_PATH.'phpcms/base.php';
$param = pc_base::load_sys_class('param');
$op = isset($_GET['op']) && trim($_GET['op']) ? trim($_GET['op']) : exit('Operation can not be empty');
if (!preg_match('/([^a-z_]+)/i',$op) && file_exists(PHPCMS_PATH.'api/'.$op.'.php')) {
include PHPCMS_PATH.'api/'.$op.'.php';
} else {
exit('API handler does not exist');
}
?>
|
108wo
|
api.php
|
PHP
|
asf20
| 595
|
package org.poly2tri.triangulation.point.ardor3d;
import java.util.ArrayList;
import java.util.List;
import org.poly2tri.geometry.polygon.PolygonPoint;
import org.poly2tri.triangulation.TriangulationPoint;
import com.ardor3d.math.Vector3;
public class ArdorVector3PolygonPoint extends PolygonPoint
{
private final Vector3 _p;
public ArdorVector3PolygonPoint( Vector3 point )
{
super( point.getX(), point.getY() );
_p = point;
}
public final double getX()
{
return _p.getX();
}
public final double getY()
{
return _p.getY();
}
public final double getZ()
{
return _p.getZ();
}
public final float getXf()
{
return _p.getXf();
}
public final float getYf()
{
return _p.getYf();
}
public final float getZf()
{
return _p.getZf();
}
public static List<PolygonPoint> toPoints( Vector3[] vpoints )
{
ArrayList<PolygonPoint> points = new ArrayList<PolygonPoint>(vpoints.length);
for( int i=0; i<vpoints.length; i++ )
{
points.add( new ArdorVector3PolygonPoint(vpoints[i]) );
}
return points;
}
public static List<PolygonPoint> toPoints( ArrayList<Vector3> vpoints )
{
int i=0;
ArrayList<PolygonPoint> points = new ArrayList<PolygonPoint>(vpoints.size());
for( Vector3 point : vpoints )
{
points.add( new ArdorVector3PolygonPoint(point) );
}
return points;
}
}
|
11025063-pizibing
|
poly2tri-ardor3d/src/main/java/org/poly2tri/triangulation/point/ardor3d/ArdorVector3PolygonPoint.java
|
Java
|
bsd
| 1,641
|
package org.poly2tri.triangulation.point.ardor3d;
import java.util.ArrayList;
import java.util.List;
import org.poly2tri.triangulation.TriangulationPoint;
import com.ardor3d.math.Vector3;
public class ArdorVector3Point extends TriangulationPoint
{
private final Vector3 _p;
public ArdorVector3Point( Vector3 point )
{
_p = point;
}
public final double getX()
{
return _p.getX();
}
public final double getY()
{
return _p.getY();
}
public final double getZ()
{
return _p.getZ();
}
public final float getXf()
{
return _p.getXf();
}
public final float getYf()
{
return _p.getYf();
}
public final float getZf()
{
return _p.getZf();
}
@Override
public void set( double x, double y, double z )
{
_p.set( x, y, z );
}
public static List<TriangulationPoint> toPoints( Vector3[] vpoints )
{
ArrayList<TriangulationPoint> points = new ArrayList<TriangulationPoint>(vpoints.length);
for( int i=0; i<vpoints.length; i++ )
{
points.add( new ArdorVector3Point(vpoints[i]) );
}
return points;
}
public static List<TriangulationPoint> toPoints( ArrayList<Vector3> vpoints )
{
int i=0;
ArrayList<TriangulationPoint> points = new ArrayList<TriangulationPoint>(vpoints.size());
for( Vector3 point : vpoints )
{
points.add( new ArdorVector3Point(point) );
}
return points;
}
public static List<TriangulationPoint> toPolygonPoints( Vector3[] vpoints )
{
ArrayList<TriangulationPoint> points = new ArrayList<TriangulationPoint>(vpoints.length);
for( int i=0; i<vpoints.length; i++ )
{
points.add( new ArdorVector3PolygonPoint(vpoints[i]) );
}
return points;
}
public static List<TriangulationPoint> toPolygonPoints( ArrayList<Vector3> vpoints )
{
int i=0;
ArrayList<TriangulationPoint> points = new ArrayList<TriangulationPoint>(vpoints.size());
for( Vector3 point : vpoints )
{
points.add( new ArdorVector3PolygonPoint(point) );
}
return points;
}
}
|
11025063-pizibing
|
poly2tri-ardor3d/src/main/java/org/poly2tri/triangulation/point/ardor3d/ArdorVector3Point.java
|
Java
|
bsd
| 2,416
|
package org.poly2tri.triangulation.tools.ardor3d;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.util.HashMap;
import java.util.List;
import org.poly2tri.geometry.polygon.Polygon;
import org.poly2tri.geometry.primitives.Point;
import org.poly2tri.transform.coordinate.CoordinateTransform;
import org.poly2tri.transform.coordinate.NoTransform;
import org.poly2tri.triangulation.TriangulationPoint;
import org.poly2tri.triangulation.delaunay.DelaunayTriangle;
import org.poly2tri.triangulation.point.TPoint;
import org.poly2tri.triangulation.sets.PointSet;
import com.ardor3d.math.Vector3;
import com.ardor3d.renderer.IndexMode;
import com.ardor3d.scenegraph.Mesh;
import com.ardor3d.util.geom.BufferUtils;
public class ArdorMeshMapper
{
private static final CoordinateTransform _ct = new NoTransform();
public static void updateTriangleMesh( Mesh mesh,
List<DelaunayTriangle> triangles )
{
updateTriangleMesh( mesh, triangles, _ct );
}
public static void updateTriangleMesh( Mesh mesh,
List<DelaunayTriangle> triangles,
CoordinateTransform pc )
{
FloatBuffer vertBuf;
TPoint point;
mesh.getMeshData().setIndexMode( IndexMode.Triangles );
if( triangles == null || triangles.size() == 0 )
{
return;
}
point = new TPoint(0,0,0);
int size = 3*3*triangles.size();
prepareVertexBuffer( mesh, size );
vertBuf = mesh.getMeshData().getVertexBuffer();
vertBuf.rewind();
for( DelaunayTriangle t : triangles )
{
for( int i=0; i<3; i++ )
{
pc.transform( t.points[i], point );
vertBuf.put(point.getXf());
vertBuf.put(point.getYf());
vertBuf.put(point.getZf());
}
}
}
public static void updateFaceNormals( Mesh mesh,
List<DelaunayTriangle> triangles )
{
updateFaceNormals( mesh, triangles, _ct );
}
public static void updateFaceNormals( Mesh mesh,
List<DelaunayTriangle> triangles,
CoordinateTransform pc )
{
FloatBuffer nBuf;
Vector3 fNormal;
HashMap<DelaunayTriangle,Vector3> fnMap;
int size = 3*3*triangles.size();
fnMap = calculateFaceNormals( triangles, pc );
prepareNormalBuffer( mesh, size );
nBuf = mesh.getMeshData().getNormalBuffer();
nBuf.rewind();
for( DelaunayTriangle t : triangles )
{
fNormal = fnMap.get( t );
for( int i=0; i<3; i++ )
{
nBuf.put(fNormal.getXf());
nBuf.put(fNormal.getYf());
nBuf.put(fNormal.getZf());
}
}
}
public static void updateVertexNormals( Mesh mesh,
List<DelaunayTriangle> triangles )
{
updateVertexNormals( mesh, triangles, _ct );
}
public static void updateVertexNormals( Mesh mesh,
List<DelaunayTriangle> triangles,
CoordinateTransform pc )
{
FloatBuffer nBuf;
TriangulationPoint vertex;
Vector3 vNormal, fNormal;
HashMap<DelaunayTriangle,Vector3> fnMap;
HashMap<TriangulationPoint,Vector3> vnMap = new HashMap<TriangulationPoint,Vector3>(3*triangles.size());
int size = 3*3*triangles.size();
fnMap = calculateFaceNormals( triangles, pc );
// Calculate a vertex normal for each vertex
for( DelaunayTriangle t : triangles )
{
fNormal = fnMap.get( t );
for( int i=0; i<3; i++ )
{
vertex = t.points[i];
vNormal = vnMap.get( vertex );
if( vNormal == null )
{
vNormal = new Vector3( fNormal.getX(), fNormal.getY(), fNormal.getZ() );
vnMap.put( vertex, vNormal );
}
else
{
vNormal.addLocal( fNormal );
}
}
}
// Normalize all normals
for( Vector3 normal : vnMap.values() )
{
normal.normalizeLocal();
}
prepareNormalBuffer( mesh, size );
nBuf = mesh.getMeshData().getNormalBuffer();
nBuf.rewind();
for( DelaunayTriangle t : triangles )
{
for( int i=0; i<3; i++ )
{
vertex = t.points[i];
vNormal = vnMap.get( vertex );
nBuf.put(vNormal.getXf());
nBuf.put(vNormal.getYf());
nBuf.put(vNormal.getZf());
}
}
}
private static HashMap<DelaunayTriangle,Vector3> calculateFaceNormals( List<DelaunayTriangle> triangles,
CoordinateTransform pc )
{
HashMap<DelaunayTriangle,Vector3> normals = new HashMap<DelaunayTriangle,Vector3>(triangles.size());
TPoint point = new TPoint(0,0,0);
// calculate the Face Normals for all triangles
float x1,x2,x3,y1,y2,y3,z1,z2,z3,nx,ny,nz,ux,uy,uz,vx,vy,vz;
double norm;
for( DelaunayTriangle t : triangles )
{
pc.transform( t.points[0], point );
x1 = point.getXf();
y1 = point.getYf();
z1 = point.getZf();
pc.transform( t.points[1], point );
x2 = point.getXf();
y2 = point.getYf();
z2 = point.getZf();
pc.transform( t.points[2], point );
x3 = point.getXf();
y3 = point.getYf();
z3 = point.getZf();
ux = x2 - x1;
uy = y2 - y1;
uz = z2 - z1;
vx = x3 - x1;
vy = y3 - y1;
vz = z3 - z1;
nx = uy*vz - uz*vy;
ny = uz*vx - ux*vz;
nz = ux*vy - uy*vx;
norm = 1/Math.sqrt( nx*nx + ny*ny + nz*nz );
nx *= norm;
ny *= norm;
nz *= norm;
normals.put( t, new Vector3(nx,ny,nz) );
}
return normals;
}
/**
* For now very primitive!
*
* Assumes a single texture and that the triangles form a xy-monotone surface
* <p>
* A continuous surface S in R3 is called xy-monotone, if every line parallel
* to the z-axis intersects it at a single point at most.
*
* @param mesh
* @param scale
*/
public static void updateTextureCoordinates( Mesh mesh,
List<DelaunayTriangle> triangles,
double scale,
double angle )
{
TriangulationPoint vertex;
FloatBuffer tcBuf;
float width,maxX,minX,maxY,minY,x,y,xn,yn;
maxX = Float.NEGATIVE_INFINITY;
minX = Float.POSITIVE_INFINITY;
maxY = Float.NEGATIVE_INFINITY;
minY = Float.POSITIVE_INFINITY;
for( DelaunayTriangle t : triangles )
{
for( int i=0; i<3; i++ )
{
vertex = t.points[i];
x = vertex.getXf();
y = vertex.getYf();
maxX = x > maxX ? x : maxX;
minX = x < minX ? x : minX;
maxY = y > maxY ? y : maxY;
minY = y < minY ? x : minY;
}
}
width = maxX-minX > maxY-minY ? maxX-minX : maxY-minY;
width *= scale;
tcBuf = prepareTextureCoordinateBuffer(mesh,0,2*3*triangles.size());
tcBuf.rewind();
for( DelaunayTriangle t : triangles )
{
for( int i=0; i<3; i++ )
{
vertex = t.points[i];
x = vertex.getXf()-(maxX-minX)/2;
y = vertex.getYf()-(maxY-minY)/2;
xn = (float)(x*Math.cos(angle)-y*Math.sin(angle));
yn = (float)(y*Math.cos(angle)+x*Math.sin(angle));
tcBuf.put( xn/width );
tcBuf.put( yn/width );
}
}
}
/**
* Assuming:
* 1. That given U anv V aren't collinear.
* 2. That O,U and V can be projected in the XY plane
*
* @param mesh
* @param triangles
* @param o
* @param u
* @param v
*/
public static void updateTextureCoordinates( Mesh mesh,
List<DelaunayTriangle> triangles,
double scale,
Point o,
Point u,
Point v )
{
FloatBuffer tcBuf;
float x,y,a,b;
final float ox = (float)scale*o.getXf();
final float oy = (float)scale*o.getYf();
final float ux = (float)scale*u.getXf();
final float uy = (float)scale*u.getYf();
final float vx = (float)scale*v.getXf();
final float vy = (float)scale*v.getYf();
final float vCu = (vx*uy-vy*ux);
final boolean doX = Math.abs( ux ) > Math.abs( uy );
tcBuf = prepareTextureCoordinateBuffer(mesh,0,2*3*triangles.size());
tcBuf.rewind();
for( DelaunayTriangle t : triangles )
{
for( int i=0; i<3; i++ )
{
x = t.points[i].getXf()-ox;
y = t.points[i].getYf()-oy;
// Calculate the texture coordinate in the UV plane
a = (uy*x - ux*y)/vCu;
if( doX )
{
b = (x - a*vx)/ux;
}
else
{
b = (y - a*vy)/uy;
}
tcBuf.put( a );
tcBuf.put( b );
}
}
}
// FloatBuffer vBuf,tcBuf;
// float width,maxX,minX,maxY,minY,x,y,xn,yn;
//
// maxX = Float.NEGATIVE_INFINITY;
// minX = Float.POSITIVE_INFINITY;
// maxY = Float.NEGATIVE_INFINITY;
// minY = Float.POSITIVE_INFINITY;
//
// vBuf = mesh.getMeshData().getVertexBuffer();
// for( int i=0; i < vBuf.limit()-1; i+=3 )
// {
// x = vBuf.get(i);
// y = vBuf.get(i+1);
//
// maxX = x > maxX ? x : maxX;
// minX = x < minX ? x : minX;
// maxY = y > maxY ? y : maxY;
// minY = y < minY ? x : minY;
// }
//
// width = maxX-minX > maxY-minY ? maxX-minX : maxY-minY;
// width *= scale;
//
// vBuf = mesh.getMeshData().getVertexBuffer();
// tcBuf = prepareTextureCoordinateBuffer(mesh,0,2*vBuf.limit()/3);
// tcBuf.rewind();
//
// for( int i=0; i < vBuf.limit()-1; i+=3 )
// {
// x = vBuf.get(i)-(maxX-minX)/2;
// y = vBuf.get(i+1)-(maxY-minY)/2;
// xn = (float)(x*Math.cos(angle)-y*Math.sin(angle));
// yn = (float)(y*Math.cos(angle)+x*Math.sin(angle));
// tcBuf.put( xn/width );
// tcBuf.put( yn/width );
// }
public static void updateTriangleMesh( Mesh mesh, PointSet ps, CoordinateTransform pc )
{
updateTriangleMesh( mesh, ps.getTriangles(), pc );
}
/**
* Will populate a given Mesh's vertex,index buffer and set IndexMode.Triangles<br>
* Will also increase buffer sizes if needed by creating new buffers.
*
* @param mesh
* @param ps
*/
public static void updateTriangleMesh( Mesh mesh, PointSet ps )
{
updateTriangleMesh( mesh, ps.getTriangles() );
}
public static void updateTriangleMesh( Mesh mesh, Polygon p )
{
updateTriangleMesh( mesh, p.getTriangles() );
}
public static void updateTriangleMesh( Mesh mesh, Polygon p, CoordinateTransform pc )
{
updateTriangleMesh( mesh, p.getTriangles(), pc );
}
public static void updateVertexBuffer( Mesh mesh, List<? extends Point> list )
{
FloatBuffer vertBuf;
int size = 3*list.size();
prepareVertexBuffer( mesh, size );
if( size == 0 )
{
return;
}
vertBuf = mesh.getMeshData().getVertexBuffer();
vertBuf.rewind();
for( Point p : list )
{
vertBuf.put(p.getXf()).put(p.getYf()).put(p.getZf());
}
}
public static void updateIndexBuffer( Mesh mesh, int[] index )
{
IntBuffer indexBuf;
if( index == null || index.length == 0 )
{
return;
}
int size = index.length;
prepareIndexBuffer( mesh, size );
indexBuf = mesh.getMeshData().getIndexBuffer();
indexBuf.rewind();
for( int i=0; i<size; i+=2 )
{
indexBuf.put(index[i]).put( index[i+1] );
}
}
private static void prepareVertexBuffer( Mesh mesh, int size )
{
FloatBuffer vertBuf;
vertBuf = mesh.getMeshData().getVertexBuffer();
if( vertBuf == null || vertBuf.capacity() < size )
{
vertBuf = BufferUtils.createFloatBuffer( size );
mesh.getMeshData().setVertexBuffer( vertBuf );
}
else
{
vertBuf.limit( size );
mesh.getMeshData().updateVertexCount();
}
}
private static void prepareNormalBuffer( Mesh mesh, int size )
{
FloatBuffer nBuf;
nBuf = mesh.getMeshData().getNormalBuffer();
if( nBuf == null || nBuf.capacity() < size )
{
nBuf = BufferUtils.createFloatBuffer( size );
mesh.getMeshData().setNormalBuffer( nBuf );
}
else
{
nBuf.limit( size );
}
}
private static void prepareIndexBuffer( Mesh mesh, int size)
{
IntBuffer indexBuf = mesh.getMeshData().getIndexBuffer();
if( indexBuf == null || indexBuf.capacity() < size )
{
indexBuf = BufferUtils.createIntBuffer( size );
mesh.getMeshData().setIndexBuffer( indexBuf );
}
else
{
indexBuf.limit( size );
}
}
private static FloatBuffer prepareTextureCoordinateBuffer( Mesh mesh, int index, int size )
{
FloatBuffer tcBuf;
tcBuf = mesh.getMeshData().getTextureBuffer( index );
if( tcBuf == null || tcBuf.capacity() < size )
{
tcBuf = BufferUtils.createFloatBuffer( size );
mesh.getMeshData().setTextureBuffer( tcBuf, index );
}
else
{
tcBuf.limit( size );
}
return tcBuf;
}
}
|
11025063-pizibing
|
poly2tri-ardor3d/src/main/java/org/poly2tri/triangulation/tools/ardor3d/ArdorMeshMapper.java
|
Java
|
bsd
| 15,811
|
package org.poly2tri.polygon.ardor3d;
import java.util.ArrayList;
import org.poly2tri.geometry.polygon.Polygon;
import org.poly2tri.triangulation.point.ardor3d.ArdorVector3Point;
import org.poly2tri.triangulation.point.ardor3d.ArdorVector3PolygonPoint;
import com.ardor3d.math.Vector3;
public class ArdorPolygon extends Polygon
{
public ArdorPolygon( Vector3[] points )
{
super( ArdorVector3PolygonPoint.toPoints( points ) );
}
public ArdorPolygon( ArrayList<Vector3> points )
{
super( ArdorVector3PolygonPoint.toPoints( points ) );
}
}
|
11025063-pizibing
|
poly2tri-ardor3d/src/main/java/org/poly2tri/polygon/ardor3d/ArdorPolygon.java
|
Java
|
bsd
| 604
|
package org.poly2tri.examples.ardor3d;
import java.util.ArrayList;
import org.poly2tri.Poly2Tri;
import org.poly2tri.examples.ardor3d.base.P2TSimpleExampleBase;
import org.poly2tri.geometry.polygon.Polygon;
import org.poly2tri.geometry.polygon.PolygonPoint;
import org.poly2tri.triangulation.tools.ardor3d.ArdorMeshMapper;
import com.ardor3d.framework.FrameHandler;
import com.ardor3d.input.logical.LogicalLayer;
import com.ardor3d.math.ColorRGBA;
import com.ardor3d.renderer.state.WireframeState;
import com.ardor3d.scenegraph.Mesh;
import com.ardor3d.scenegraph.Node;
import com.google.inject.Inject;
public class CDTHoleExample extends P2TSimpleExampleBase
{
public static void main(final String[] args)
{
start(CDTHoleExample.class);
}
@Inject
public CDTHoleExample( LogicalLayer logicalLayer, FrameHandler frameHandler )
{
super( logicalLayer, frameHandler );
}
@Override
protected void initExample()
{
super.initExample();
Node node = new Node();
node.setRenderState( new WireframeState() );
_node.attachChild( node );
Polygon circle;
Polygon hole;
circle = createCirclePolygon( 64, 25, 1 );
hole = createCirclePolygon( 32, 25, 0.25, -0.5, -0.5 );
circle.addHole( hole );
hole = createCirclePolygon( 64, 25, 0.5, 0.25, 0.25 );
circle.addHole( hole );
Mesh mesh = new Mesh();
mesh.setDefaultColor( ColorRGBA.RED );
mesh.setTranslation( 0, 0, 0.01 );
node.attachChild( mesh );
Mesh mesh2 = new Mesh();
mesh2.setDefaultColor( ColorRGBA.BLUE );
_node.attachChild( mesh2 );
Poly2Tri.triangulate( circle );
ArdorMeshMapper.updateTriangleMesh( mesh, circle );
ArdorMeshMapper.updateTriangleMesh( mesh2, circle );
}
private Polygon createCirclePolygon( int n, double scale, double radius )
{
return createCirclePolygon( n, scale, radius, 0, 0 );
}
private Polygon createCirclePolygon( int n,
double scale,
double radius,
double x,
double y )
{
if( n < 3 ) n=3;
PolygonPoint[] points = new PolygonPoint[n];
for( int i=0; i<n; i++ )
{
points[i] = new PolygonPoint( scale*(x + radius*Math.cos( (2.0*Math.PI*i)/n )),
scale*(y + radius*Math.sin( (2.0*Math.PI*i)/n ) ));
}
return new Polygon( points );
}
}
|
11025063-pizibing
|
poly2tri-examples/src/main/java/org/poly2tri/examples/ardor3d/CDTHoleExample.java
|
Java
|
bsd
| 2,773
|
package org.poly2tri.examples.ardor3d.base;
import java.net.URISyntaxException;
import org.lwjgl.opengl.Display;
import com.ardor3d.example.ExampleBase;
import com.ardor3d.framework.FrameHandler;
import com.ardor3d.image.Texture;
import com.ardor3d.image.Image.Format;
import com.ardor3d.input.logical.LogicalLayer;
import com.ardor3d.renderer.queue.RenderBucketType;
import com.ardor3d.renderer.state.BlendState;
import com.ardor3d.renderer.state.TextureState;
import com.ardor3d.renderer.state.WireframeState;
import com.ardor3d.scenegraph.Node;
import com.ardor3d.scenegraph.hint.LightCombineMode;
import com.ardor3d.scenegraph.shape.Quad;
import com.ardor3d.util.TextureManager;
import com.ardor3d.util.resource.ResourceLocatorTool;
import com.ardor3d.util.resource.SimpleResourceLocator;
import com.google.inject.Inject;
public abstract class P2TSimpleExampleBase extends ExampleBase
{
protected Node _node;
protected Quad _logotype;
protected int _width,_height;
@Inject
public P2TSimpleExampleBase( LogicalLayer logicalLayer, FrameHandler frameHandler )
{
super( logicalLayer, frameHandler );
}
@Override
protected void initExample()
{
_canvas.setVSyncEnabled( true );
_canvas.getCanvasRenderer().getCamera().setLocation(0, 0, 65);
_width = Display.getDisplayMode().getWidth();
_height = Display.getDisplayMode().getHeight();
_root.getSceneHints().setLightCombineMode( LightCombineMode.Off );
_node = new Node();
_node.getSceneHints().setLightCombineMode( LightCombineMode.Off );
// _node.setRenderState( new WireframeState() );
_root.attachChild( _node );
try {
SimpleResourceLocator srl = new SimpleResourceLocator(ExampleBase.class.getClassLoader().getResource("org/poly2tri/examples/data/"));
ResourceLocatorTool.addResourceLocator(ResourceLocatorTool.TYPE_MODEL, srl);
SimpleResourceLocator sr2 = new SimpleResourceLocator(ExampleBase.class.getClassLoader().getResource("org/poly2tri/examples/textures/"));
ResourceLocatorTool.addResourceLocator(ResourceLocatorTool.TYPE_TEXTURE, sr2);
} catch (final URISyntaxException ex) {
ex.printStackTrace();
}
_logotype = new Quad("box", 128, 128 );
_logotype.setTranslation( 74, _height - 74, 0 );
_logotype.getSceneHints().setRenderBucketType( RenderBucketType.Ortho );
BlendState bs = new BlendState();
bs.setBlendEnabled( true );
bs.setEnabled( true );
bs.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
bs.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha);
_logotype.setRenderState( bs );
TextureState ts = new TextureState();
ts.setEnabled(true);
ts.setTexture(TextureManager.load("poly2tri_logotype_256x256.png",
Texture.MinificationFilter.Trilinear,
Format.GuessNoCompression, true));
_logotype.setRenderState(ts);
_root.attachChild( _logotype );
}
}
|
11025063-pizibing
|
poly2tri-examples/src/main/java/org/poly2tri/examples/ardor3d/base/P2TSimpleExampleBase.java
|
Java
|
bsd
| 3,237
|
package org.poly2tri.examples.ardor3d.base;
import java.nio.FloatBuffer;
import java.util.List;
import org.poly2tri.geometry.polygon.PolygonSet;
import org.poly2tri.triangulation.TriangulationAlgorithm;
import org.poly2tri.triangulation.TriangulationPoint;
import org.poly2tri.triangulation.TriangulationProcess;
import org.poly2tri.triangulation.delaunay.DelaunayTriangle;
import org.poly2tri.triangulation.delaunay.sweep.DTSweepContext;
import org.poly2tri.triangulation.tools.ardor3d.ArdorMeshMapper;
import com.ardor3d.framework.Canvas;
import com.ardor3d.framework.FrameHandler;
import com.ardor3d.input.Key;
import com.ardor3d.input.logical.InputTrigger;
import com.ardor3d.input.logical.KeyPressedCondition;
import com.ardor3d.input.logical.LogicalLayer;
import com.ardor3d.input.logical.TriggerAction;
import com.ardor3d.input.logical.TwoInputStates;
import com.ardor3d.math.ColorRGBA;
import com.ardor3d.math.Vector3;
import com.ardor3d.renderer.IndexMode;
import com.ardor3d.renderer.queue.RenderBucketType;
import com.ardor3d.renderer.state.WireframeState;
import com.ardor3d.scenegraph.Mesh;
import com.ardor3d.scenegraph.MeshData;
import com.ardor3d.scenegraph.Node;
import com.ardor3d.scenegraph.Point;
import com.ardor3d.scenegraph.hint.LightCombineMode;
import com.ardor3d.ui.text.BasicText;
import com.ardor3d.util.ReadOnlyTimer;
import com.ardor3d.util.geom.BufferUtils;
public abstract class P2TExampleBase extends P2TSimpleExampleBase
{
protected TriangulationProcess _process;
protected CDTSweepMesh _cdtSweepMesh;
protected CDTSweepPoints _cdtSweepPoints;
protected PolygonSet _polygonSet;
private long _processTimestamp;
/** Text fields used to present info about the example. */
protected final BasicText _exampleInfo[] = new BasicText[7];
public P2TExampleBase( LogicalLayer logicalLayer, FrameHandler frameHandler )
{
super( logicalLayer, frameHandler );
}
@Override
protected void initExample()
{
super.initExample();
// Warmup the triangulation code for better performance
// when we need triangulation during runtime
// Poly2Tri.warmup();
_process = new TriangulationProcess(TriangulationAlgorithm.DTSweep);
_cdtSweepPoints = new CDTSweepPoints();
_cdtSweepMesh = new CDTSweepMesh();
_node.attachChild( _cdtSweepPoints.getSceneNode() );
_node.attachChild( _cdtSweepMesh.getSceneNode() );
final Node textNodes = new Node("Text");
textNodes.getSceneHints().setRenderBucketType(RenderBucketType.Ortho);
textNodes.getSceneHints().setLightCombineMode(LightCombineMode.Off);
_root.attachChild( textNodes );
for (int i = 0; i < _exampleInfo.length; i++)
{
_exampleInfo[i] = BasicText.createDefaultTextLabel("Text", "", 16);
_exampleInfo[i].setTranslation(new Vector3(10, (_exampleInfo.length-i-1) * 20 + 10, 0));
textNodes.attachChild(_exampleInfo[i]);
}
updateText();
}
protected DTSweepContext getContext()
{
return (DTSweepContext)_process.getContext();
}
/**
* Update text information.
*/
protected void updateText()
{
_exampleInfo[0].setText("");
_exampleInfo[1].setText("[Home] Toggle wireframe");
_exampleInfo[2].setText("[End] Toggle vertex points");
}
@Override
protected void updateExample(final ReadOnlyTimer timer)
{
if( _process.isDone() && _processTimestamp != _process.getTimestamp() )
{
_processTimestamp = _process.getTimestamp();
updateMesh();
_exampleInfo[0].setText("[" + _process.getTriangulationTime() + "ms] " + _process.getPointCount() + " points" );
}
}
public void exit()
{
super.exit();
_process.shutdown();
}
protected void triangulate()
{
_process.triangulate( _polygonSet );
}
protected void updateMesh()
{
if( _process.getContext().getTriangulatable() != null )
{
if( _process.getContext().isDebugEnabled() )
{
if( _process.isDone() )
{
_cdtSweepMesh.update( _process.getContext().getTriangulatable().getTriangles() );
_cdtSweepPoints.update( _process.getContext().getTriangulatable().getPoints() );
}
else
{
_cdtSweepMesh.update( _process.getContext().getTriangles() );
_cdtSweepPoints.update( _process.getContext().getPoints() );
}
}
else
{
_cdtSweepMesh.update( _polygonSet.getPolygons().get(0).getTriangles() );
_cdtSweepPoints.update( _polygonSet.getPolygons().get(0).getPoints() );
}
}
}
@Override
public void registerInputTriggers()
{
super.registerInputTriggers();
_controlHandle.setMoveSpeed( 10 );
// HOME - toogleWireframe
_logicalLayer.registerTrigger( new InputTrigger( new KeyPressedCondition( Key.HOME ), new TriggerAction() {
public void perform( final Canvas canvas, final TwoInputStates inputState, final double tpf )
{
_cdtSweepMesh.toogleWireframe();
}
} ) );
// END - tooglePoints
_logicalLayer.registerTrigger( new InputTrigger( new KeyPressedCondition( Key.END ), new TriggerAction() {
public void perform( final Canvas canvas, final TwoInputStates inputState, final double tpf )
{
_cdtSweepPoints.toogleVisibile();
}
} ) );
}
protected abstract class SceneElement<A>
{
protected Node _node;
public SceneElement(String name)
{
_node = new Node(name);
_node.getSceneHints().setAllPickingHints( false );
}
public abstract void update( A element );
public Node getSceneNode()
{
return _node;
}
}
protected class CDTSweepPoints extends SceneElement<List<TriangulationPoint>>
{
private Point m_point = new Point();
private boolean _pointsVisible = true;
public CDTSweepPoints()
{
super("Mesh");
m_point.setDefaultColor( ColorRGBA.RED );
m_point.setPointSize( 1 );
m_point.setTranslation( 0, 0, 0.01 );
_node.attachChild( m_point );
MeshData md = m_point.getMeshData();
int size = 1000;
FloatBuffer vertBuf = BufferUtils.createFloatBuffer( (int)size*3 );
md.setVertexBuffer( vertBuf );
}
public void toogleVisibile()
{
if( _pointsVisible )
{
m_point.removeFromParent();
_pointsVisible = false;
}
else
{
_node.attachChild( m_point );
_pointsVisible = true;
}
}
@Override
public void update( List<TriangulationPoint> list )
{
ArdorMeshMapper.updateVertexBuffer( m_point, list );
}
}
protected class CDTSweepMesh extends SceneElement<List<DelaunayTriangle>>
{
private Mesh m_mesh = new Mesh();
private WireframeState _ws = new WireframeState();
public CDTSweepMesh()
{
super("Mesh");
MeshData md;
m_mesh.setDefaultColor( ColorRGBA.BLUE );
m_mesh.setRenderState( _ws );
_node.attachChild( m_mesh );
md = m_mesh.getMeshData();
int size = 1000;
FloatBuffer vertBuf = BufferUtils.createFloatBuffer( (int)size*3*3 );
md.setVertexBuffer( vertBuf );
md.setIndexMode( IndexMode.Triangles );
}
public void toogleWireframe()
{
if( _ws.isEnabled() )
{
_ws.setEnabled( false );
}
else
{
_ws.setEnabled( true );
}
}
@Override
public void update( List<DelaunayTriangle> triangles )
{
ArdorMeshMapper.updateTriangleMesh( m_mesh, triangles );
}
}
}
|
11025063-pizibing
|
poly2tri-examples/src/main/java/org/poly2tri/examples/ardor3d/base/P2TExampleBase.java
|
Java
|
bsd
| 9,020
|
package org.poly2tri.examples.ardor3d.misc;
public enum ExampleModels
{
Test ("test.dat",1,0,0,true),
Two ("2.dat",1,0,0,true),
Debug ("debug.dat",1,0,0,false),
Debug2 ("debug2.dat",1,0,0,false),
Bird ("bird.dat",1,0,0,false),
Custom ("funny.dat",1,0,0,false),
Diamond ("diamond.dat",1,0,0,false),
Dude ("dude.dat",1,-0.1,0,true),
Nazca_heron ("nazca_heron.dat",1.3,0,0.35,false),
Nazca_monkey ("nazca_monkey.dat",1,0,0,false),
Star ("star.dat",1,0,0,false),
Strange ("strange.dat",1,0,0,true),
Tank ("tank.dat",1.3,0,0,true);
private final static String m_basePath = "org/poly2tri/examples/data/";
private String m_filename;
private double m_scale;
private double m_x;
private double m_y;
private boolean _invertedYAxis;
ExampleModels( String filename, double scale, double x, double y, boolean invertedY )
{
m_filename = filename;
m_scale = scale;
m_x = x;
m_y = y;
_invertedYAxis = invertedY;
}
public String getFilename()
{
return m_basePath + m_filename;
}
public double getScale()
{
return m_scale;
}
public double getX()
{
return m_x;
}
public double getY()
{
return m_y;
}
public boolean invertedYAxis()
{
return _invertedYAxis;
}
}
|
11025063-pizibing
|
poly2tri-examples/src/main/java/org/poly2tri/examples/ardor3d/misc/ExampleModels.java
|
Java
|
bsd
| 1,573
|
/**
* Copyright (c) 2008-2009 Ardor Labs, Inc.
*
* This file is part of Ardor3D.
*
* Ardor3D is free software: you can redistribute it and/or modify it
* under the terms of its license which may be found in the accompanying
* LICENSE file or at <http://www.ardor3d.com/LICENSE>.
*/
package org.poly2tri.examples.ardor3d.misc;
import java.nio.FloatBuffer;
import com.ardor3d.math.Vector3;
import com.ardor3d.math.type.ReadOnlyVector3;
import com.ardor3d.scenegraph.Mesh;
import com.ardor3d.util.geom.BufferUtils;
public class Triangle extends Mesh
{
private static final long serialVersionUID = 1L;
public Triangle()
{
this( "Triangle" );
}
public Triangle(final String name )
{
this( name,
new Vector3( Math.cos( Math.toRadians( 90 ) ), Math.sin( Math.toRadians( 90 ) ), 0 ),
new Vector3( Math.cos( Math.toRadians( 210 ) ), Math.sin( Math.toRadians( 210 ) ), 0 ),
new Vector3( Math.cos( Math.toRadians( 330 ) ), Math.sin( Math.toRadians( 330 ) ), 0 ));
}
public Triangle(final String name,
ReadOnlyVector3 a,
ReadOnlyVector3 b,
ReadOnlyVector3 c )
{
super(name);
initialize(a,b,c);
}
/**
* <code>resize</code> changes the width and height of the given quad by altering its vertices.
*
* @param width
* the new width of the <code>Quad</code>.
* @param height
* the new height of the <code>Quad</code>.
*/
// public void resize( double radius )
// {
// _meshData.getVertexBuffer().clear();
// _meshData.getVertexBuffer().put((float) (-width / 2)).put((float) (height / 2)).put(0);
// _meshData.getVertexBuffer().put((float) (-width / 2)).put((float) (-height / 2)).put(0);
// _meshData.getVertexBuffer().put((float) (width / 2)).put((float) (-height / 2)).put(0);
// _meshData.getVertexBuffer().put((float) (width / 2)).put((float) (height / 2)).put(0);
// }
/**
* <code>initialize</code> builds the data for the <code>Quad</code> object.
*
* @param width
* the width of the <code>Quad</code>.
* @param height
* the height of the <code>Quad</code>.
*/
private void initialize(ReadOnlyVector3 a, ReadOnlyVector3 b, ReadOnlyVector3 c )
{
final int verts = 3;
_meshData.setVertexBuffer(BufferUtils.createVector3Buffer(3));
_meshData.setNormalBuffer(BufferUtils.createVector3Buffer(3));
final FloatBuffer tbuf = BufferUtils.createVector2Buffer(3);
_meshData.setTextureBuffer(tbuf, 0);
_meshData.setIndexBuffer(BufferUtils.createIntBuffer(3));
Vector3 ba = Vector3.fetchTempInstance();
Vector3 ca = Vector3.fetchTempInstance();
ba.set( b ).subtractLocal( a );
ca.set( c ).subtractLocal( a );
ba.crossLocal( ca ).normalizeLocal();
_meshData.getNormalBuffer().put(ba.getXf()).put(ba.getYf()).put(ba.getZf());
_meshData.getNormalBuffer().put(ba.getXf()).put(ba.getYf()).put(ba.getZf());
_meshData.getNormalBuffer().put(ba.getXf()).put(ba.getYf()).put(ba.getZf());
Vector3.releaseTempInstance( ba );
Vector3.releaseTempInstance( ca );
tbuf.put(0).put(1);
tbuf.put(0).put(0);
tbuf.put(1).put(0);
_meshData.getIndexBuffer().put(0);
_meshData.getIndexBuffer().put(1);
_meshData.getIndexBuffer().put(2);
_meshData.getVertexBuffer().put(a.getXf()).put(a.getYf()).put(a.getZf());
_meshData.getVertexBuffer().put(b.getXf()).put(b.getYf()).put(b.getZf());
_meshData.getVertexBuffer().put(c.getXf()).put(c.getYf()).put(c.getZf());
}
}
|
11025063-pizibing
|
poly2tri-examples/src/main/java/org/poly2tri/examples/ardor3d/misc/Triangle.java
|
Java
|
bsd
| 3,822
|
package org.poly2tri.examples.ardor3d.misc;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;
import org.poly2tri.geometry.polygon.Polygon;
import org.poly2tri.polygon.ardor3d.ArdorPolygon;
import org.poly2tri.triangulation.TriangulationPoint;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.ardor3d.math.Vector3;
public class PolygonLoader
{
private final static Logger logger = LoggerFactory.getLogger( PolygonLoader.class );
public static Polygon loadModel( ExampleModels model, double scale ) throws FileNotFoundException, IOException
{
String line;
ArrayList<Vector3> points = new ArrayList<Vector3>();
InputStream istream = PolygonLoader.class.getClassLoader().getResourceAsStream( model.getFilename() );
if( istream == null )
{
throw new FileNotFoundException( "Couldn't find " + model );
}
InputStreamReader ir = new InputStreamReader( istream );
BufferedReader reader = new BufferedReader( ir );
while( ( line = reader.readLine() ) != null )
{
StringTokenizer tokens = new StringTokenizer( line, " ," );
points.add( new Vector3( Float.valueOf( tokens.nextToken() ).floatValue(),
Float.valueOf( tokens.nextToken() ).floatValue(),
0f ));
}
if( points.isEmpty() )
{
throw new IOException( "no data in file " + model );
}
// Rescale models so they are centered at 0,0 and don't fall outside the
// unit square
double maxX, maxY, minX, minY;
maxX = minX = points.get( 0 ).getX();
if( model.invertedYAxis() )
{
maxY = minY = -points.get( 0 ).getY();
}
else
{
maxY = minY = points.get( 0 ).getY();
}
for( Vector3 p : points )
{
if( model.invertedYAxis() )
{
p.setY( -p.getY() );
}
maxX = p.getX() > maxX ? p.getX() : maxX;
maxY = p.getY() > maxY ? p.getY() : maxY;
minX = p.getX() < minX ? p.getX() : minX;
minY = p.getY() < minY ? p.getY() : minY;
}
double width, height, xScale, yScale;
width = maxX - minX;
height = maxY - minY;
xScale = scale * 1f / width;
yScale = scale * 1f / height;
// System.out.println("scale/height=" + SCALE + "/" + height );
// System.out.println("scale=" + yScale);
for( Vector3 p : points )
{
if( model.invertedYAxis() )
{
p.subtractLocal( maxX - width / 2, maxY - height / 2, 0 );
}
else
{
p.subtractLocal( maxX - width / 2, maxY - height / 2, 0 );
}
p.multiplyLocal( xScale < yScale ? xScale : yScale );
}
return new ArdorPolygon( points);
}
public static void saveModel( String path, TriangulationPoint[] points )
{
FileWriter writer = null;
BufferedWriter w = null;
String file = path+System.currentTimeMillis()+".dat";
try
{
writer = new FileWriter(file);
w = new BufferedWriter(writer);
for( TriangulationPoint p : points )
{
w.write( Float.toString( p.getXf() ) +" "+ Float.toString( p.getYf() ));
w.newLine();
}
logger.info( "Saved polygon\n" + file );
}
catch( IOException e )
{
logger.error( "Failed to save model" );
}
finally
{
if( w != null )
{
try
{
w.close();
}
catch( IOException e2 )
{
}
}
}
}
/**
* This is a very unoptimal dump of the triangles as absolute lines.
* For manual importation to an SVG<br>
*
* @param path
* @param ps
*/
// public static void saveTriLine( String path, PolygonSet ps )
// {
// FileWriter writer = null;
// BufferedWriter w = null;
// String file = path+System.currentTimeMillis()+".tri";
//
// if( ps.getTriangles() == null || ps.getTriangles().isEmpty() )
// {
// return;
// }
//
// try
// {
//
// writer = new FileWriter(file);
// w = new BufferedWriter(writer);
// for( DelaunayTriangle t : ps.getTriangles() )
// {
// for( int i=0; i<3; i++ )
// {
// w.write( Float.toString( t.points[i].getXf() ) +","+ Float.toString( t.points[i].getYf() )+" ");
// }
//// w.newLine();
// }
// logger.info( "Saved triangle lines\n" + file );
// }
// catch( IOException e )
// {
// logger.error( "Failed to save triangle lines" + e.getMessage() );
// }
// finally
// {
// if( w != null )
// {
// try
// {
// w.close();
// }
// catch( IOException e2 )
// {
// }
// }
// }
// }
}
|
11025063-pizibing
|
poly2tri-examples/src/main/java/org/poly2tri/examples/ardor3d/misc/PolygonLoader.java
|
Java
|
bsd
| 5,967
|
package org.poly2tri.examples.ardor3d.misc;
public enum ExampleSets
{
Example1 ("example1.dat",1,0,0,true),
Example2 ("example2.dat",1,0,0,true),
Example3 ("example3.dat",1,0,0,false),
Example4 ("example4.dat",1,0,0,false);
private final static String m_basePath = "org/poly2tri/examples/data/pointsets/";
private String m_filename;
private double m_scale;
private double m_x;
private double m_y;
private boolean _invertedYAxis;
ExampleSets( String filename, double scale, double x, double y, boolean invertedY )
{
m_filename = filename;
m_scale = scale;
m_x = x;
m_y = y;
_invertedYAxis = invertedY;
}
public String getFilename()
{
return m_basePath + m_filename;
}
public double getScale()
{
return m_scale;
}
public double getX()
{
return m_x;
}
public double getY()
{
return m_y;
}
public boolean invertedYAxis()
{
return _invertedYAxis;
}
}
|
11025063-pizibing
|
poly2tri-examples/src/main/java/org/poly2tri/examples/ardor3d/misc/ExampleSets.java
|
Java
|
bsd
| 1,143
|
package org.poly2tri.examples.ardor3d.misc;
import org.poly2tri.triangulation.point.TPoint;
public class MyPoint extends TPoint
{
int index;
public MyPoint( double x, double y )
{
super( x, y );
}
public void setIndex(int i)
{
index = i;
}
public int getIndex()
{
return index;
}
public boolean equals(Object other)
{
if (!(other instanceof MyPoint)) return false;
MyPoint p = (MyPoint)other;
return getX() == p.getX() && getY() == p.getY();
}
public int hashCode() { return (int)getX() + (int)getY(); }
}
|
11025063-pizibing
|
poly2tri-examples/src/main/java/org/poly2tri/examples/ardor3d/misc/MyPoint.java
|
Java
|
bsd
| 667
|
package org.poly2tri.examples.ardor3d.misc;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;
import org.poly2tri.geometry.polygon.Polygon;
import org.poly2tri.geometry.polygon.PolygonSet;
import org.poly2tri.polygon.ardor3d.ArdorPolygon;
import org.poly2tri.triangulation.TriangulationPoint;
import org.poly2tri.triangulation.delaunay.DelaunayTriangle;
import org.poly2tri.triangulation.point.TPoint;
import org.poly2tri.triangulation.sets.PointSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.ardor3d.math.Vector3;
public class DataLoader
{
private final static Logger logger = LoggerFactory.getLogger( DataLoader.class );
public static Polygon loadModel( ExampleModels model, double scale )
throws FileNotFoundException, IOException
{
String line;
ArrayList<Vector3> points = new ArrayList<Vector3>();
InputStream istream = DataLoader.class.getClassLoader().getResourceAsStream( model.getFilename() );
if( istream == null )
{
throw new FileNotFoundException( "Couldn't find " + model );
}
InputStreamReader ir = new InputStreamReader( istream );
BufferedReader reader = new BufferedReader( ir );
while( ( line = reader.readLine() ) != null )
{
StringTokenizer tokens = new StringTokenizer( line, " ," );
points.add( new Vector3( Double.valueOf( tokens.nextToken() ).doubleValue(),
Double.valueOf( tokens.nextToken() ).doubleValue(),
0f ));
}
if( points.isEmpty() )
{
throw new IOException( "no data in file " + model );
}
// Rescale models so they are centered at 0,0 and don't fall outside the
// unit square
double maxX, maxY, minX, minY;
maxX = minX = points.get( 0 ).getX();
if( model.invertedYAxis() )
{
maxY = minY = -points.get( 0 ).getY();
}
else
{
maxY = minY = points.get( 0 ).getY();
}
for( Vector3 p : points )
{
if( model.invertedYAxis() )
{
p.setY( -p.getY() );
}
maxX = p.getX() > maxX ? p.getX() : maxX;
maxY = p.getY() > maxY ? p.getY() : maxY;
minX = p.getX() < minX ? p.getX() : minX;
minY = p.getY() < minY ? p.getY() : minY;
}
double width, height, xScale, yScale;
width = maxX - minX;
height = maxY - minY;
xScale = scale * 1f / width;
yScale = scale * 1f / height;
// System.out.println("scale/height=" + SCALE + "/" + height );
// System.out.println("scale=" + yScale);
for( Vector3 p : points )
{
if( model.invertedYAxis() )
{
p.subtractLocal( maxX - width / 2, maxY - height / 2, 0 );
}
else
{
p.subtractLocal( maxX - width / 2, maxY - height / 2, 0 );
}
p.multiplyLocal( xScale < yScale ? xScale : yScale );
}
return new ArdorPolygon( points);
}
public static PointSet loadPointSet( ExampleSets set, double scale )
throws FileNotFoundException, IOException
{
String line;
ArrayList<TriangulationPoint> points = new ArrayList<TriangulationPoint>();
InputStream istream = DataLoader.class.getClassLoader().getResourceAsStream( set.getFilename() );
if( istream == null )
{
throw new FileNotFoundException( "Couldn't find " + set );
}
InputStreamReader ir = new InputStreamReader( istream );
BufferedReader reader = new BufferedReader( ir );
while( ( line = reader.readLine() ) != null )
{
StringTokenizer tokens = new StringTokenizer( line, " ," );
points.add( new TPoint( scale*Float.valueOf( tokens.nextToken() ).floatValue(),
scale*Float.valueOf( tokens.nextToken() ).floatValue() ));
}
if( points.isEmpty() )
{
throw new IOException( "no data in file " + set );
}
// Rescale models so they are centered at 0,0 and don't fall outside the
// unit square
// double maxX, maxY, minX, minY;
// maxX = minX = points.get( 0 ).getX();
// if( set.invertedYAxis() )
// {
// maxY = minY = -points.get( 0 ).getY();
// }
// else
// {
// maxY = minY = points.get( 0 ).getY();
// }
// for( TPoint p : points )
// {
// if( set.invertedYAxis() )
// {
// p.setY( -p.getY() );
// }
// maxX = p.getX() > maxX ? p.getX() : maxX;
// maxY = p.getY() > maxY ? p.getY() : maxY;
// minX = p.getX() < minX ? p.getX() : minX;
// minY = p.getY() < minY ? p.getY() : minY;
// }
//
// double width, height, xScale, yScale;
// width = maxX - minX;
// height = maxY - minY;
// xScale = scale * 1f / width;
// yScale = scale * 1f / height;
//
// // System.out.println("scale/height=" + SCALE + "/" + height );
// // System.out.println("scale=" + yScale);
//
// for( TPoint p : points )
// {
// if( set.invertedYAxis() )
// {
// p.subtractLocal( maxX - width / 2, maxY - height / 2, 0 );
// }
// else
// {
// p.subtractLocal( maxX - width / 2, maxY - height / 2, 0 );
// }
// p.multiplyLocal( xScale < yScale ? xScale : yScale );
// }
return new PointSet( points );
}
public static void saveModel( String path, TriangulationPoint[] points )
{
FileWriter writer = null;
BufferedWriter w = null;
String file = path+System.currentTimeMillis()+".dat";
try
{
writer = new FileWriter(file);
w = new BufferedWriter(writer);
for( TriangulationPoint p : points )
{
w.write( Float.toString( p.getXf() ) +" "+ Float.toString( p.getYf() ));
w.newLine();
}
logger.info( "Saved polygon\n" + file );
}
catch( IOException e )
{
logger.error( "Failed to save model" );
}
finally
{
if( w != null )
{
try
{
w.close();
}
catch( IOException e2 )
{
}
}
}
}
/**
* This is a very unoptimal dump of the triangles as absolute lines.
* For manual importation to an SVG<br>
*
* @param path
* @param ps
*/
public static void saveTriLine( String path, PolygonSet ps )
{
FileWriter writer = null;
BufferedWriter w = null;
String file = path+System.currentTimeMillis()+".tri";
if( ps.getPolygons() == null || ps.getPolygons().isEmpty() )
{
return;
}
try
{
writer = new FileWriter(file);
w = new BufferedWriter(writer);
for( DelaunayTriangle t : ps.getPolygons().get(0).getTriangles() )
{
for( int i=0; i<3; i++ )
{
w.write( Float.toString( t.points[i].getXf() ) +","+ Float.toString( t.points[i].getYf() )+" ");
}
// w.newLine();
}
logger.info( "Saved triangle lines\n" + file );
}
catch( IOException e )
{
logger.error( "Failed to save triangle lines" + e.getMessage() );
}
finally
{
if( w != null )
{
try
{
w.close();
}
catch( IOException e2 )
{
}
}
}
}
}
|
11025063-pizibing
|
poly2tri-examples/src/main/java/org/poly2tri/examples/ardor3d/misc/DataLoader.java
|
Java
|
bsd
| 8,703
|
/* Poly2Tri
* Copyright (c) 2009-2010, Poly2Tri Contributors
* http://code.google.com/p/poly2tri/
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of Poly2Tri nor the names of its contributors may be
* used to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.poly2tri.examples.ardor3d;
import java.io.IOException;
import java.nio.FloatBuffer;
import java.util.ArrayList;
import java.util.List;
import org.poly2tri.examples.ardor3d.base.P2TExampleBase;
import org.poly2tri.examples.ardor3d.misc.DataLoader;
import org.poly2tri.examples.ardor3d.misc.ExampleModels;
import org.poly2tri.examples.ardor3d.misc.Triangle;
import org.poly2tri.geometry.polygon.Polygon;
import org.poly2tri.geometry.polygon.PolygonSet;
import org.poly2tri.triangulation.TriangulationPoint;
import org.poly2tri.triangulation.delaunay.DelaunayTriangle;
import org.poly2tri.triangulation.delaunay.sweep.AdvancingFront;
import org.poly2tri.triangulation.delaunay.sweep.AdvancingFrontNode;
import org.poly2tri.triangulation.delaunay.sweep.DTSweepConstraint;
import org.poly2tri.triangulation.delaunay.sweep.DTSweepContext;
import org.poly2tri.triangulation.point.TPoint;
import org.poly2tri.triangulation.sets.ConstrainedPointSet;
import org.poly2tri.triangulation.sets.PointSet;
import org.poly2tri.triangulation.util.PolygonGenerator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.ardor3d.framework.Canvas;
import com.ardor3d.framework.FrameHandler;
import com.ardor3d.input.Key;
import com.ardor3d.input.logical.InputTrigger;
import com.ardor3d.input.logical.KeyPressedCondition;
import com.ardor3d.input.logical.LogicalLayer;
import com.ardor3d.input.logical.TriggerAction;
import com.ardor3d.input.logical.TwoInputStates;
import com.ardor3d.math.ColorRGBA;
import com.ardor3d.renderer.IndexMode;
import com.ardor3d.renderer.state.WireframeState;
import com.ardor3d.scenegraph.Line;
import com.ardor3d.scenegraph.Point;
import com.ardor3d.util.ReadOnlyTimer;
import com.ardor3d.util.geom.BufferUtils;
import com.google.inject.Inject;
/**
* Toggle Model with PageUp and PageDown<br>
* Toggle Wireframe with Home<br>
* Toggle Vertex points with End<br>
* Use 1 and 2 to generate random polygons<br>
*
* @author Thomas
*
*/
public class CDTModelExample extends P2TExampleBase
{
private final static Logger logger = LoggerFactory.getLogger( CDTModelExample.class );
private ExampleModels m_currentModel = ExampleModels.Two;
private static double SCALE = 50;
private Line m_line;
// Build parameters
private int m_vertexCount = 10000;
// Scene components
private CDTSweepAdvancingFront _cdtSweepAdvancingFront;
private CDTSweepActiveNode _cdtSweepActiveNode;
private CDTSweepActiveTriangles _cdtSweepActiveTriangle;
private CDTSweepActiveEdge _cdtSweepActiveEdge;
// private GUICircumCircle m_circumCircle;
private int m_stepCount = 0;
private boolean m_autoStep = true;
private final String m_dataPath = "src/main/resources/org/poly2tri/examples/data/";
public static void main(final String[] args)
{
start(CDTModelExample.class);
}
@Inject
public CDTModelExample( LogicalLayer logicalLayer, FrameHandler frameHandler )
{
super( logicalLayer, frameHandler );
}
protected void updateExample(final ReadOnlyTimer timer)
{
super.updateExample( timer );
if( getContext().isDebugEnabled() )
{
int count = _process.getStepCount();
if( m_stepCount < count )
{
_process.requestRead();
if( _process.isReadable() )
{
updateMesh();
m_stepCount = count;
if( m_autoStep )
{
_process.resume();
}
}
}
}
}
@Override
protected void initExample()
{
super.initExample();
// getContext().isDebugEnabled( true );
if( getContext().isDebugEnabled() )
{
_cdtSweepAdvancingFront = new CDTSweepAdvancingFront();
_node.attachChild( _cdtSweepAdvancingFront.getSceneNode() );
_cdtSweepActiveNode = new CDTSweepActiveNode();
_node.attachChild( _cdtSweepActiveNode.getSceneNode() );
_cdtSweepActiveTriangle = new CDTSweepActiveTriangles();
_node.attachChild( _cdtSweepActiveTriangle.getSceneNode() );
_cdtSweepActiveEdge = new CDTSweepActiveEdge();
_node.attachChild( _cdtSweepActiveEdge.getSceneNode() );
// m_circumCircle = new GUICircumCircle();
// m_node.attachChild( m_circumCircle.getSceneNode() );
}
buildModel(m_currentModel);
triangulate();
}
/**
* Update text information.
*/
protected void updateText()
{
super.updateText();
_exampleInfo[3].setText("[PageUp] Next model");
_exampleInfo[4].setText("[PageDown] Previous model");
_exampleInfo[5].setText("[1] Generate polygon type A ");
_exampleInfo[6].setText("[2] Generate polygon type B ");
}
private void buildModel( ExampleModels model )
{
Polygon poly;
if( model != null )
{
try
{
poly = DataLoader.loadModel( model, SCALE );
_polygonSet = new PolygonSet( poly );
}
catch( IOException e )
{
logger.info( "Failed to load model {}", e.getMessage() );
model = null;
}
}
if( model == null )
{
_polygonSet = new PolygonSet( PolygonGenerator.RandomCircleSweep( SCALE, m_vertexCount ) );
}
}
private ConstrainedPointSet buildCustom()
{
ArrayList<TriangulationPoint> list = new ArrayList<TriangulationPoint>(20);
int[] index;
list.add( new TPoint(2.2715518,-4.5233157) );
list.add( new TPoint(3.4446202,-3.5232647) );
list.add( new TPoint(4.7215156,-4.5233157) );
list.add( new TPoint(6.0311967,-3.5232647) );
list.add( new TPoint(3.4446202,-7.2578132) );
list.add( new TPoint(.81390847,-3.5232647) );
index = new int[]{3,5};
return new ConstrainedPointSet( list, index );
}
protected void triangulate()
{
super.triangulate();
m_stepCount = 0;
}
protected void updateMesh()
{
super.updateMesh();
DTSweepContext tcx = getContext();
if( tcx.isDebugEnabled() )
{
_cdtSweepActiveTriangle.update( tcx );
_cdtSweepActiveEdge.update( tcx );
_cdtSweepActiveNode.update( tcx );
_cdtSweepAdvancingFront.update( tcx );
// m_circumCircle.update( tcx.getCircumCircle() );
}
}
@Override
public void registerInputTriggers()
{
super.registerInputTriggers();
// SPACE - toggle models
_logicalLayer.registerTrigger( new InputTrigger( new KeyPressedCondition( Key.PAGEUP_PRIOR ), new TriggerAction() {
public void perform( final Canvas canvas, final TwoInputStates inputState, final double tpf )
{
int index;
index = (m_currentModel.ordinal()+1)%ExampleModels.values().length;
m_currentModel = ExampleModels.values()[index];
buildModel(m_currentModel);
_node.setScale( m_currentModel.getScale() );
triangulate();
}
} ) );
// SPACE - toggle models backwards
_logicalLayer.registerTrigger( new InputTrigger( new KeyPressedCondition( Key.PAGEDOWN_NEXT ), new TriggerAction() {
public void perform( final Canvas canvas, final TwoInputStates inputState, final double tpf )
{
int index;
index = ((m_currentModel.ordinal()-1)%ExampleModels.values().length + ExampleModels.values().length)%ExampleModels.values().length;
m_currentModel = ExampleModels.values()[index];
buildModel(m_currentModel);
_node.setScale( m_currentModel.getScale() );
triangulate();
}
} ) );
_logicalLayer.registerTrigger( new InputTrigger( new KeyPressedCondition( Key.ONE ), new TriggerAction() {
public void perform( final Canvas canvas, final TwoInputStates inputState, final double tpf )
{
_polygonSet = new PolygonSet( PolygonGenerator.RandomCircleSweep( SCALE, m_vertexCount ) );
triangulate();
}
} ) );
_logicalLayer.registerTrigger( new InputTrigger( new KeyPressedCondition( Key.TWO ), new TriggerAction() {
public void perform( final Canvas canvas, final TwoInputStates inputState, final double tpf )
{
_polygonSet = new PolygonSet( PolygonGenerator.RandomCircleSweep2( SCALE, 200 ) );
triangulate();
}
} ) );
// X -start
_logicalLayer.registerTrigger( new InputTrigger( new KeyPressedCondition( Key.X ), new TriggerAction() {
public void perform( final Canvas canvas, final TwoInputStates inputState, final double tpf )
{
// Lets create a TriangulationProcess that allows you to step thru the TriangulationAlgorithm
// _process.getContext().isDebugEnabled( true );
// _process.triangulate();
// m_stepCount = 0;
}
} ) );
// C - step
_logicalLayer.registerTrigger( new InputTrigger( new KeyPressedCondition( Key.C ), new TriggerAction() {
public void perform( final Canvas canvas, final TwoInputStates inputState, final double tpf )
{
// updateMesh();
_process.resume();
}
} ) );
// Z - toggle autostep
_logicalLayer.registerTrigger( new InputTrigger( new KeyPressedCondition( Key.Z ), new TriggerAction() {
public void perform( final Canvas canvas, final TwoInputStates inputState, final double tpf )
{
m_autoStep = m_autoStep ? false : true;
}
} ) );
// space - save triangle lines
_logicalLayer.registerTrigger( new InputTrigger( new KeyPressedCondition( Key.SPACE ), new TriggerAction() {
public void perform( final Canvas canvas, final TwoInputStates inputState, final double tpf )
{
// PolygonLoader.saveTriLine( m_dataPath, _polygonSet );
m_stepCount = 0;
_process.triangulate( buildCustom() );
}
} ) );
}
class CDTSweepAdvancingFront extends SceneElement<DTSweepContext>
{
protected Line m_nodeLines;
protected Point m_frontPoints;
protected Line m_frontLine;
public CDTSweepAdvancingFront()
{
super("AdvancingFront");
m_frontLine = new Line();
m_frontLine.getMeshData().setIndexMode( IndexMode.LineStrip );
m_frontLine.getMeshData().setVertexBuffer( BufferUtils.createVector3Buffer( 800 ) );
m_frontLine.setDefaultColor( ColorRGBA.ORANGE );
m_frontLine.setTranslation( 0, 0.05, 0 );
_node.attachChild( m_frontLine );
m_frontPoints = new Point();
m_frontPoints.getMeshData().setVertexBuffer( m_frontLine.getMeshData().getVertexBuffer() );
m_frontPoints.setPointSize( 6 );
m_frontPoints.setDefaultColor( ColorRGBA.ORANGE );
m_frontPoints.setTranslation( 0, 0.05, 0 );
_node.attachChild( m_frontPoints );
m_nodeLines = new Line();
m_nodeLines.getMeshData().setIndexMode( IndexMode.Lines );
m_nodeLines.getMeshData().setVertexBuffer( BufferUtils.createVector3Buffer( 2*800 ) );
m_nodeLines.setDefaultColor( ColorRGBA.YELLOW );
m_nodeLines.setTranslation( 0, 0.05, 0 );
_node.attachChild( m_nodeLines );
}
@Override
public void update( DTSweepContext tcx )
{
AdvancingFront front = ((DTSweepContext)tcx).getAdvancingFront();
AdvancingFrontNode node;
DelaunayTriangle tri;
if( front == null ) return;
FloatBuffer fb = m_frontLine.getMeshData().getVertexBuffer();
FloatBuffer nodeVert = m_nodeLines.getMeshData().getVertexBuffer();
fb.limit( fb.capacity() );
nodeVert.limit( fb.capacity() );
fb.rewind();
nodeVert.rewind();
int count=0;
node = front.head;
TriangulationPoint point;
do
{
point = node.getPoint();
fb.put( point.getXf() ).put( point.getYf() ).put( point.getZf() );
tri = node.getTriangle();
if( tri != null )
{
nodeVert.put( point.getXf() ).put( point.getYf() ).put( point.getZf() );
nodeVert.put( ( tri.points[0].getXf() + tri.points[1].getXf() + tri.points[2].getXf() )/3 );
nodeVert.put( ( tri.points[0].getYf() + tri.points[1].getYf() + tri.points[2].getYf() )/3 );
nodeVert.put( ( tri.points[0].getZf() + tri.points[1].getZf() + tri.points[2].getZf() )/3 );
}
count++;
} while( (node = node.getNext()) != null );
fb.limit( 3*count );
nodeVert.limit( 2*count*3 );
}
}
// class GUICircumCircle extends SceneElement<Tuple2<TriangulationPoint,Double>>
// {
// private int VCNT = 64;
// private Line m_circle = new Line();
//
// public GUICircumCircle()
// {
// super("CircumCircle");
// m_circle.getMeshData().setIndexMode( IndexMode.LineLoop );
// m_circle.getMeshData().setVertexBuffer( BufferUtils.createVector3Buffer( VCNT ) );
// m_circle.setDefaultColor( ColorRGBA.WHITE );
// m_circle.setLineWidth( 1 );
// m_node.attachChild( m_circle );
// }
//
// @Override
// public void update( Tuple2<TriangulationPoint,Double> circle )
// {
// float x,y;
// if( circle.a != null )
// {
// FloatBuffer fb = m_circle.getMeshData().getVertexBuffer();
// fb.rewind();
// for( int i=0; i < VCNT; i++ )
// {
// x = (float)circle.a.getX() + (float)(circle.b*Math.cos( 2*Math.PI*((double)i%VCNT)/VCNT ));
// y = (float)circle.a.getY() + (float)(circle.b*Math.sin( 2*Math.PI*((double)i%VCNT)/VCNT ));
// fb.put( x ).put( y ).put( 0 );
// }
// }
// else
// {
// m_node.detachAllChildren();
// }
// }
// }
class CDTSweepMeshExtended extends CDTSweepMesh
{
// private Line m_conLine = new Line();
public CDTSweepMeshExtended()
{
super();
// Line that show the connection between triangles
// m_conLine.setDefaultColor( ColorRGBA.RED );
// m_conLine.getMeshData().setIndexMode( IndexMode.Lines );
// m_node.attachChild( m_conLine );
//
// vertBuf = BufferUtils.createFloatBuffer( size*3*3*3 );
// m_conLine.getMeshData().setVertexBuffer( vertBuf );
}
@Override
public void update( List<DelaunayTriangle> triangles )
{
super.update( triangles );
// MeshData md;
// Vector3 v1 = Vector3.fetchTempInstance();
// Vector3 v2 = Vector3.fetchTempInstance();
// FloatBuffer v2Buf;
//
//
// md = m_mesh.getMeshData();
// v2Buf = m_conLine.getMeshData().getVertexBuffer();
//
//// logger.info( "Triangle count [{}]", tcx.getMap().size() );
//
// int size = 2*3*3*ps.getTriangles().size();
// if( v2Buf.capacity() < size )
// {
// v2Buf = BufferUtils.createFloatBuffer( size );
// m_conLine.getMeshData().setVertexBuffer( v2Buf );
// }
// else
// {
// v2Buf.limit( 2*size );
// }
//
// v2Buf.rewind();
// int lineCount=0;
// ArdorVector3Point p;
// for( DelaunayTriangle t : ps.getTriangles() )
// {
// v1.set( t.points[0] ).addLocal( t.points[1] ).addLocal( t.points[2] ).multiplyLocal( 1.0d/3 );
// if( t.neighbors[0] != null )
// {
// v2.set( t.points[2] ).subtractLocal( t.points[1] ).multiplyLocal( 0.5 ).addLocal( t.points[1] );
// v2Buf.put( v1.getXf() ).put( v1.getYf() ).put( v1.getZf() );
// v2Buf.put( v2.getXf() ).put( v2.getYf() ).put( v2.getZf() );
// lineCount++;
// }
// if( t.neighbors[1] != null )
// {
// v2.set( t.points[0] ).subtractLocal( t.points[2] ).multiplyLocal( 0.5 ).addLocal( t.points[2] );
// v2Buf.put( v1.getXf() ).put( v1.getYf() ).put( v1.getZf() );
// v2Buf.put( v2.getXf() ).put( v2.getYf() ).put( v2.getZf() );
// lineCount++;
// }
// if( t.neighbors[2] != null )
// {
// v2.set( t.points[1] ).subtractLocal( t.points[0] ).multiplyLocal( 0.5 ).addLocal( t.points[0] );
// v2Buf.put( v1.getXf() ).put( v1.getYf() ).put( v1.getZf() );
// v2Buf.put( v2.getXf() ).put( v2.getYf() ).put( v2.getZf() );
// lineCount++;
// }
// }
// v2Buf.limit( 2*3*lineCount );
// Vector3.releaseTempInstance( v1 );
// Vector3.releaseTempInstance( v2 );
}
}
class CDTSweepActiveEdge extends SceneElement<DTSweepContext>
{
private Line m_edgeLine = new Line();
public CDTSweepActiveEdge()
{
super("ActiveEdge");
m_edgeLine.getMeshData().setIndexMode( IndexMode.Lines );
m_edgeLine.getMeshData().setVertexBuffer( BufferUtils.createVector3Buffer( 2 ) );
m_edgeLine.setDefaultColor( ColorRGBA.YELLOW );
m_edgeLine.setLineWidth( 3 );
}
@Override
public void update( DTSweepContext tcx )
{
DTSweepConstraint edge = tcx.getDebugContext().getActiveConstraint();
if( edge != null )
{
FloatBuffer fb = m_edgeLine.getMeshData().getVertexBuffer();
fb.rewind();
fb.put( edge.getP().getXf() ).put( edge.getP().getYf() ).put( 0 );
fb.put( edge.getQ().getXf() ).put( edge.getQ().getYf() ).put( 0 );
_node.attachChild( m_edgeLine );
}
else
{
_node.detachAllChildren();
}
}
}
class CDTSweepActiveTriangles extends SceneElement<DTSweepContext>
{
private Triangle m_a = new Triangle();
private Triangle m_b = new Triangle();
public CDTSweepActiveTriangles()
{
super("ActiveTriangles");
_node.getSceneHints().setAllPickingHints( false );
m_a.setDefaultColor( new ColorRGBA( 0.8f,0.8f,0.8f,1.0f ) );
m_b.setDefaultColor( new ColorRGBA( 0.5f,0.5f,0.5f,1.0f ) );
}
public void setScale( double scale )
{
m_a.setScale( scale );
m_b.setScale( scale );
}
@Override
public void update( DTSweepContext tcx )
{
DelaunayTriangle t,t2;
t = tcx.getDebugContext().getPrimaryTriangle();
t2 = tcx.getDebugContext().getSecondaryTriangle();
_node.detachAllChildren();
if( t != null )
{
FloatBuffer fb = m_a.getMeshData().getVertexBuffer();
fb.rewind();
fb.put( t.points[0].getXf() ).put( t.points[0].getYf() ).put( t.points[0].getZf() );
fb.put( t.points[1].getXf() ).put( t.points[1].getYf() ).put( t.points[1].getZf() );
fb.put( t.points[2].getXf() ).put( t.points[2].getYf() ).put( t.points[2].getZf() );
_node.attachChild( m_a );
}
if( t2 != null )
{
FloatBuffer fb = m_b.getMeshData().getVertexBuffer();
fb.rewind();
fb.put( t2.points[0].getXf() ).put( t2.points[0].getYf() ).put( t2.points[0].getZf() );
fb.put( t2.points[1].getXf() ).put( t2.points[1].getYf() ).put( t2.points[1].getZf() );
fb.put( t2.points[2].getXf() ).put( t2.points[2].getYf() ).put( t2.points[2].getZf() );
_node.attachChild( m_b );
}
}
}
class CDTSweepActiveNode extends SceneElement<DTSweepContext>
{
private Triangle m_a = new Triangle();
private Triangle m_b = new Triangle();
private Triangle m_c = new Triangle();
public CDTSweepActiveNode()
{
super("WorkingNode");
_node.setRenderState( new WireframeState() );
m_a.setDefaultColor( ColorRGBA.DARK_GRAY );
m_b.setDefaultColor( ColorRGBA.LIGHT_GRAY );
m_c.setDefaultColor( ColorRGBA.DARK_GRAY );
setScale( 0.5 );
}
public void setScale( double scale )
{
m_a.setScale( scale );
m_b.setScale( scale );
m_c.setScale( scale );
}
@Override
public void update( DTSweepContext tcx )
{
AdvancingFrontNode node = tcx.getDebugContext().getActiveNode();
TriangulationPoint p;
if( node != null )
{
if( node.getPrevious() != null )
{
p = node.getPrevious().getPoint();
m_a.setTranslation( p.getXf(), p.getYf(), p.getZf() );
}
p = node.getPoint();
m_b.setTranslation( p.getXf(), p.getYf(), p.getZf() );
if( node.getNext() != null )
{
p = node.getNext().getPoint();
m_c.setTranslation( p.getXf(), p.getYf(), p.getZf() );
}
_node.attachChild( m_a );
_node.attachChild( m_b );
_node.attachChild( m_c );
}
else
{
_node.detachAllChildren();
}
}
}
}
|
11025063-pizibing
|
poly2tri-examples/src/main/java/org/poly2tri/examples/ardor3d/CDTModelExample.java
|
Java
|
bsd
| 25,670
|
package org.poly2tri.examples.ardor3d;
import java.io.IOException;
import java.util.ArrayList;
import org.poly2tri.Poly2Tri;
import org.poly2tri.examples.ardor3d.base.P2TSimpleExampleBase;
import org.poly2tri.examples.ardor3d.misc.DataLoader;
import org.poly2tri.examples.ardor3d.misc.ExampleSets;
import org.poly2tri.triangulation.TriangulationAlgorithm;
import org.poly2tri.triangulation.TriangulationContext;
import org.poly2tri.triangulation.TriangulationPoint;
import org.poly2tri.triangulation.point.TPoint;
import org.poly2tri.triangulation.sets.PointSet;
import org.poly2tri.triangulation.tools.ardor3d.ArdorMeshMapper;
import org.poly2tri.triangulation.util.PointGenerator;
import com.ardor3d.framework.FrameHandler;
import com.ardor3d.input.logical.LogicalLayer;
import com.ardor3d.math.ColorRGBA;
import com.ardor3d.renderer.state.WireframeState;
import com.ardor3d.scenegraph.Mesh;
import com.google.inject.Inject;
public class DTUniformDistributionExample extends P2TSimpleExampleBase
{
public static void main(final String[] args)
{
start(DTUniformDistributionExample.class);
}
@Inject
public DTUniformDistributionExample( LogicalLayer logicalLayer, FrameHandler frameHandler )
{
super( logicalLayer, frameHandler );
}
@Override
protected void initExample()
{
super.initExample();
PointSet ps;
Mesh mesh;
mesh = new Mesh();
mesh.setDefaultColor( ColorRGBA.BLUE );
mesh.setRenderState( new WireframeState() );
_node.attachChild( mesh );
try
{
ps = DataLoader.loadPointSet( ExampleSets.Example2, 0.1 );
ps = new PointSet( PointGenerator.uniformDistribution( 10000, 60 ) );
Poly2Tri.triangulate( ps );
ArdorMeshMapper.updateTriangleMesh( mesh, ps );
}
catch( IOException e )
{}
}
}
|
11025063-pizibing
|
poly2tri-examples/src/main/java/org/poly2tri/examples/ardor3d/DTUniformDistributionExample.java
|
Java
|
bsd
| 1,990
|
package org.poly2tri.examples.ardor3d;
import java.util.List;
import org.poly2tri.Poly2Tri;
import org.poly2tri.examples.ardor3d.base.P2TSimpleExampleBase;
import org.poly2tri.triangulation.TriangulationPoint;
import org.poly2tri.triangulation.point.TPoint;
import org.poly2tri.triangulation.sets.ConstrainedPointSet;
import org.poly2tri.triangulation.tools.ardor3d.ArdorMeshMapper;
import org.poly2tri.triangulation.util.PointGenerator;
import com.ardor3d.framework.FrameHandler;
import com.ardor3d.input.logical.LogicalLayer;
import com.ardor3d.math.ColorRGBA;
import com.ardor3d.scenegraph.Mesh;
import com.google.inject.Inject;
public class CDTUniformDistributionExample extends P2TSimpleExampleBase
{
public static void main(final String[] args)
{
start(CDTUniformDistributionExample.class);
}
@Inject
public CDTUniformDistributionExample( LogicalLayer logicalLayer, FrameHandler frameHandler )
{
super( logicalLayer, frameHandler );
}
@Override
protected void initExample()
{
super.initExample();
Mesh mesh = new Mesh();
mesh.setDefaultColor( ColorRGBA.BLUE );
_node.attachChild( mesh );
double scale = 100;
int size = 1000;
int index = (int)(Math.random()*size);
List<TriangulationPoint> points = PointGenerator.uniformDistribution( size, scale );
// Lets add a constraint that cuts the uniformDistribution in half
points.add( new TPoint(0,scale/2) );
points.add( new TPoint(0,-scale/2) );
index = size;
ConstrainedPointSet cps = new ConstrainedPointSet( points, new int[]{ index, index+1 } );
Poly2Tri.triangulate( cps );
ArdorMeshMapper.updateTriangleMesh( mesh, cps );
}
}
|
11025063-pizibing
|
poly2tri-examples/src/main/java/org/poly2tri/examples/ardor3d/CDTUniformDistributionExample.java
|
Java
|
bsd
| 1,849
|
package org.poly2tri.examples.ardor3d;
import java.util.ArrayList;
import org.poly2tri.Poly2Tri;
import org.poly2tri.examples.ardor3d.base.P2TSimpleExampleBase;
import org.poly2tri.geometry.polygon.Polygon;
import org.poly2tri.geometry.polygon.PolygonPoint;
import org.poly2tri.triangulation.point.TPoint;
import org.poly2tri.triangulation.tools.ardor3d.ArdorMeshMapper;
import org.poly2tri.triangulation.util.PolygonGenerator;
import com.ardor3d.framework.FrameHandler;
import com.ardor3d.input.logical.LogicalLayer;
import com.ardor3d.math.ColorRGBA;
import com.ardor3d.renderer.state.WireframeState;
import com.ardor3d.scenegraph.Mesh;
import com.ardor3d.scenegraph.Node;
import com.google.inject.Inject;
public class CDTSteinerPointExample extends P2TSimpleExampleBase
{
public static void main(final String[] args)
{
start(CDTSteinerPointExample.class);
}
@Inject
public CDTSteinerPointExample( LogicalLayer logicalLayer, FrameHandler frameHandler )
{
super( logicalLayer, frameHandler );
}
@Override
protected void initExample()
{
super.initExample();
Node node = new Node();
node.setRenderState( new WireframeState() );
_node.attachChild( node );
Polygon poly;
poly = createCirclePolygon( 32, 1.5 );
// top left
Mesh mesh = new Mesh();
mesh.setDefaultColor( ColorRGBA.BLUE );
mesh.setTranslation( -2, 2, 0 );
node.attachChild( mesh );
Poly2Tri.triangulate( poly );
ArdorMeshMapper.updateTriangleMesh( mesh, poly );
// bottom left
mesh = new Mesh();
mesh.setDefaultColor( ColorRGBA.RED );
mesh.setTranslation( -2, -2, 0 );
node.attachChild( mesh );
poly.addSteinerPoint( new TPoint(0,0) );
Poly2Tri.triangulate( poly );
ArdorMeshMapper.updateTriangleMesh( mesh, poly );
poly = PolygonGenerator.RandomCircleSweep2( 4, 200 );
// top right
mesh = new Mesh();
mesh.setDefaultColor( ColorRGBA.BLUE );
mesh.setTranslation( 2, 2, 0 );
node.attachChild( mesh );
Poly2Tri.triangulate( poly );
ArdorMeshMapper.updateTriangleMesh( mesh, poly );
// bottom right
mesh = new Mesh();
mesh.setDefaultColor( ColorRGBA.RED );
mesh.setTranslation( 2, -2, 0 );
node.attachChild( mesh );
poly.addSteinerPoint( new TPoint(0,0) );
Poly2Tri.triangulate( poly );
ArdorMeshMapper.updateTriangleMesh( mesh, poly );
}
private Polygon createCirclePolygon( int n, double radius )
{
if( n < 3 ) n=3;
PolygonPoint[] points = new PolygonPoint[n];
for( int i=0; i<n; i++ )
{
points[i] = new PolygonPoint( radius*Math.cos( (2.0*Math.PI*i)/n ),
radius*Math.sin( (2.0*Math.PI*i)/n ) );
}
return new Polygon( points );
}
}
|
11025063-pizibing
|
poly2tri-examples/src/main/java/org/poly2tri/examples/ardor3d/CDTSteinerPointExample.java
|
Java
|
bsd
| 3,120
|
package org.poly2tri.examples;
import org.poly2tri.Poly2Tri;
import org.poly2tri.triangulation.sets.PointSet;
import org.poly2tri.triangulation.util.PointGenerator;
public class ProfilingExample
{
public static void main(final String[] args)
throws Exception
{
PointSet ps = new PointSet( PointGenerator.uniformDistribution( 50, 500000 ) );
for( int i=0; i<1; i++ )
{
Poly2Tri.triangulate( ps );
}
Thread.sleep( 10000000 );
}
public void startProfiling()
throws Exception
{
}
}
|
11025063-pizibing
|
poly2tri-examples/src/main/java/org/poly2tri/examples/ProfilingExample.java
|
Java
|
bsd
| 620
|
package org.poly2tri.examples.geotools;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
import org.geotools.data.FeatureSource;
import org.geotools.data.shapefile.ShapefileDataStore;
import org.geotools.feature.FeatureCollection;
import org.geotools.feature.FeatureIterator;
import org.opengis.feature.Feature;
import org.opengis.feature.GeometryAttribute;
import org.poly2tri.Poly2Tri;
import org.poly2tri.examples.ardor3d.base.P2TSimpleExampleBase;
import org.poly2tri.geometry.polygon.Polygon;
import org.poly2tri.geometry.polygon.PolygonPoint;
import org.poly2tri.geometry.polygon.PolygonSet;
import org.poly2tri.transform.coordinate.CoordinateTransform;
import org.poly2tri.triangulation.tools.ardor3d.ArdorMeshMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.ardor3d.example.ExampleBase;
import com.ardor3d.framework.Canvas;
import com.ardor3d.framework.FrameHandler;
import com.ardor3d.image.Image;
import com.ardor3d.image.Texture;
import com.ardor3d.image.Texture.WrapMode;
import com.ardor3d.input.MouseButton;
import com.ardor3d.input.logical.InputTrigger;
import com.ardor3d.input.logical.LogicalLayer;
import com.ardor3d.input.logical.MouseButtonClickedCondition;
import com.ardor3d.input.logical.TriggerAction;
import com.ardor3d.input.logical.TwoInputStates;
import com.ardor3d.math.ColorRGBA;
import com.ardor3d.math.MathUtils;
import com.ardor3d.math.Matrix3;
import com.ardor3d.math.Vector3;
import com.ardor3d.renderer.queue.RenderBucketType;
import com.ardor3d.renderer.state.BlendState;
import com.ardor3d.renderer.state.MaterialState;
import com.ardor3d.renderer.state.WireframeState;
import com.ardor3d.renderer.state.ZBufferState;
import com.ardor3d.renderer.state.BlendState.BlendEquation;
import com.ardor3d.scenegraph.FloatBufferData;
import com.ardor3d.scenegraph.Mesh;
import com.ardor3d.scenegraph.Node;
import com.ardor3d.scenegraph.extension.Skybox;
import com.ardor3d.scenegraph.extension.Skybox.Face;
import com.ardor3d.scenegraph.hint.LightCombineMode;
import com.ardor3d.scenegraph.shape.Sphere;
import com.ardor3d.util.ReadOnlyTimer;
import com.ardor3d.util.TextureManager;
import com.ardor3d.util.resource.ResourceLocatorTool;
import com.ardor3d.util.resource.SimpleResourceLocator;
import com.google.inject.Inject;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.LinearRing;
import com.vividsolutions.jts.geom.MultiLineString;
import com.vividsolutions.jts.geom.MultiPolygon;
/**
* Hello world!
*
*/
public class WorldExample extends P2TSimpleExampleBase
{
private final static Logger logger = LoggerFactory.getLogger( WorldExample.class );
private final static CoordinateTransform _wgs84 = new WGS84GeodeticTransform(100);
private Node _worldNode;
private Skybox _skybox;
private final Matrix3 rotate = new Matrix3();
private double angle = 0;
private boolean _doRotate = true;
/**
* We use one PolygonSet for each country since countries can have islands
* and be composed of multiple polygons
*/
private ArrayList<PolygonSet> _countries = new ArrayList<PolygonSet>();
@Inject
public WorldExample( LogicalLayer logicalLayer, FrameHandler frameHandler )
{
super( logicalLayer, frameHandler );
}
public static void main( String[] args )
throws Exception
{
try
{
start(WorldExample.class);
}
catch( RuntimeException e )
{
logger.error( "WorldExample failed due to a runtime exception" );
}
}
@Override
protected void updateExample( ReadOnlyTimer timer )
{
if( _doRotate )
{
angle += timer.getTimePerFrame() * 10;
angle %= 360;
rotate.fromAngleNormalAxis(angle * MathUtils.DEG_TO_RAD, Vector3.UNIT_Z);
_worldNode.setRotation(rotate);
}
}
@Override
protected void initExample()
{
super.initExample();
try
{
importShape(100);
}
catch( IOException e )
{
}
_canvas.getCanvasRenderer().getCamera().setLocation(200, 200, 200);
_canvas.getCanvasRenderer().getCamera().lookAt( 0, 0, 0, Vector3.UNIT_Z );
_worldNode = new Node("shape");
// _worldNode.setRenderState( new WireframeState() );
_node.attachChild( _worldNode );
buildSkyBox();
Sphere seas = new Sphere("seas", Vector3.ZERO, 64, 64, 100.2f);
seas.setDefaultColor( new ColorRGBA(0,0,0.5f,0.25f) );
seas.getSceneHints().setRenderBucketType( RenderBucketType.Transparent );
BlendState bs = new BlendState();
bs.setBlendEnabled( true );
bs.setEnabled( true );
bs.setBlendEquationAlpha( BlendEquation.Max );
bs.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
bs.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha);
seas.setRenderState( bs );
ZBufferState zb = new ZBufferState();
zb.setEnabled( true );
zb.setWritable( false );
seas.setRenderState( zb );
_worldNode.attachChild( seas );
Sphere core = new Sphere("seas", Vector3.ZERO, 16, 16, 10f);
core.getSceneHints().setLightCombineMode( LightCombineMode.Replace );
MaterialState ms = new MaterialState();
ms.setEmissive( new ColorRGBA(0.8f,0.2f,0,0.9f) );
core.setRenderState( ms );
_worldNode.attachChild( core );
Mesh mesh;
for( PolygonSet ps : _countries )
{
Poly2Tri.triangulate( ps );
float value = 1-0.9f*(float)Math.random();
for( Polygon p : ps.getPolygons() )
{
mesh = new Mesh();
mesh.setDefaultColor( new ColorRGBA( value, value, value, 1.0f ) );
_worldNode.attachChild( mesh );
ArdorMeshMapper.updateTriangleMesh( mesh, p, _wgs84 );
}
}
}
protected void importShape( double rescale )
throws IOException
{
// URL url = WorldExample.class.getResource( "/z5UKI.shp" );
URL url = WorldExample.class.getResource( "/earth/countries.shp" );
url.getFile();
ShapefileDataStore ds = new ShapefileDataStore(url);
FeatureSource featureSource = ds.getFeatureSource();
// for( int i=0; i < ds.getTypeNames().length; i++)
// {
// System.out.println("ShapefileDataStore.typename=" + ds.getTypeNames()[i] );
// }
FeatureCollection fc = featureSource.getFeatures();
// System.out.println( "featureCollection.ID=" + fc.getID() );
// System.out.println( "featureCollection.schema=" + fc.getSchema() );
// System.out.println( "featureCollection.Bounds[minX,maxX,minY,maxY]=["
// + fc.getBounds().getMinX() + "," +
// + fc.getBounds().getMaxX() + "," +
// + fc.getBounds().getMinY() + "," +
// + fc.getBounds().getMaxY() + "]" );
// double width, height, xScale, yScale, scale, dX, dY;
// width = fc.getBounds().getMaxX() - fc.getBounds().getMinX();
// height = fc.getBounds().getMaxY() - fc.getBounds().getMinY();
// dX = fc.getBounds().getMinX() + width/2;
// dY = fc.getBounds().getMinY() + height/2;
// xScale = rescale * 1f / width;
// yScale = rescale * 1f / height;
// scale = xScale < yScale ? xScale : yScale;
FeatureIterator fi;
Feature f;
GeometryAttribute geoAttrib;
Polygon polygon;
PolygonSet polygonSet;
fi = fc.features();
while( fi.hasNext() )
{
polygonSet = new PolygonSet();
f = fi.next();
geoAttrib = f.getDefaultGeometryProperty();
// System.out.println( "Feature.Identifier:" + f.getIdentifier() );
// System.out.println( "Feature.Name:" + f.getName() );
// System.out.println( "Feature.Type:" + f.getType() );
// System.out.println( "Feature.Descriptor:" + geoAttrib.getDescriptor() );
// System.out.println( "GeoAttrib.Identifier=" + geoAttrib.getIdentifier() );
// System.out.println( "GeoAttrib.Name=" + geoAttrib.getName() );
// System.out.println( "GeoAttrib.Type.Name=" + geoAttrib.getType().getName() );
// System.out.println( "GeoAttrib.Type.Binding=" + geoAttrib.getType().getBinding() );
// System.out.println( "GeoAttrib.Value=" + geoAttrib.getValue() );
if( geoAttrib.getType().getBinding() == MultiLineString.class )
{
MultiLineString mls = (MultiLineString)geoAttrib.getValue();
Coordinate[] coords = mls.getCoordinates();
// System.out.println( "MultiLineString.coordinates=" + coords.length );
ArrayList<PolygonPoint> points = new ArrayList<PolygonPoint>(coords.length);
for( int i=0; i<coords.length; i++)
{
points.add( new PolygonPoint(coords[i].x,coords[i].y) );
// System.out.println( "[x,y]=[" + coords[i].x + "," + coords[i].y + "]" );
}
polygonSet.add( new Polygon(points) );
}
else if( geoAttrib.getType().getBinding() == MultiPolygon.class )
{
MultiPolygon mp = (MultiPolygon)geoAttrib.getValue();
// System.out.println( "MultiPolygon.NumGeometries=" + mp.getNumGeometries() );
for( int i=0; i<mp.getNumGeometries(); i++ )
{
com.vividsolutions.jts.geom.Polygon jtsPolygon = (com.vividsolutions.jts.geom.Polygon)mp.getGeometryN(i);
polygon = buildPolygon( jtsPolygon );
polygonSet.add( polygon );
}
}
_countries.add( polygonSet );
}
}
private static Polygon buildPolygon( com.vividsolutions.jts.geom.Polygon jtsPolygon )
{
Polygon polygon;
LinearRing shell;
ArrayList<PolygonPoint> points;
// Envelope envelope;
// System.out.println( "MultiPolygon.points=" + jtsPolygon.getNumPoints() );
// System.out.println( "MultiPolygon.NumInteriorRing=" + jtsPolygon.getNumInteriorRing() );
// envelope = jtsPolygon.getEnvelopeInternal();
shell = (LinearRing)jtsPolygon.getExteriorRing();
Coordinate[] coords = shell.getCoordinates();
points = new ArrayList<PolygonPoint>(coords.length);
// Skipping last coordinate since JTD defines a shell as a LineString that start with
// same first and last coordinate
for( int j=0; j<coords.length-1; j++)
{
points.add( new PolygonPoint(coords[j].x,coords[j].y) );
}
polygon = new Polygon(points);
return polygon;
}
//
// private void refinePolygon()
// {
//
// }
/**
* Builds the sky box.
*/
private void buildSkyBox()
{
_skybox = new Skybox("skybox", 300, 300, 300);
try {
SimpleResourceLocator sr2 = new SimpleResourceLocator(ExampleBase.class.getClassLoader().getResource("org/poly2tri/examples/geotools/textures/"));
ResourceLocatorTool.addResourceLocator(ResourceLocatorTool.TYPE_TEXTURE, sr2);
} catch (final URISyntaxException ex) {
ex.printStackTrace();
}
final String dir = "";
final Texture stars = TextureManager.load(dir + "stars.gif",
Texture.MinificationFilter.Trilinear,
Image.Format.GuessNoCompression, true);
_skybox.setTexture(Skybox.Face.North, stars);
_skybox.setTexture(Skybox.Face.West, stars);
_skybox.setTexture(Skybox.Face.South, stars);
_skybox.setTexture(Skybox.Face.East, stars);
_skybox.setTexture(Skybox.Face.Up, stars);
_skybox.setTexture(Skybox.Face.Down, stars);
_skybox.getTexture( Skybox.Face.North ).setWrap( WrapMode.Repeat );
for( Face f : Face.values() )
{
FloatBufferData fbd = _skybox.getFace(f).getMeshData().getTextureCoords().get( 0 );
fbd.getBuffer().clear();
fbd.getBuffer().put( 0 ).put( 4 );
fbd.getBuffer().put( 0 ).put( 0 );
fbd.getBuffer().put( 4 ).put( 0 );
fbd.getBuffer().put( 4 ).put( 4 );
}
_node.attachChild( _skybox );
}
@Override
public void registerInputTriggers()
{
super.registerInputTriggers();
// SPACE - toggle models
_logicalLayer.registerTrigger( new InputTrigger( new MouseButtonClickedCondition(MouseButton.RIGHT), new TriggerAction() {
public void perform( final Canvas canvas, final TwoInputStates inputState, final double tpf )
{
_doRotate = _doRotate ? false : true;
}
} ) );
}
/*
* http://en.wikipedia.org/wiki/Longitude#Degree_length
* http://www.colorado.edu/geography/gcraft/notes/datum/gif/llhxyz.gif
*
* x (in m) = Latitude * 60 * 1852
* y (in m) = (PI/180) * cos(Longitude) * (637813.7^2 / sqrt( (637813.7 * cos(Longitude))^2 + (635675.23 * sin(Longitude))^2 ) )
* z (in m) = Altitude
*
* The 'quick and dirty' method (assuming the Earth is a perfect sphere):
*
* x = longitude*60*1852*cos(latitude)
* y = latitude*60*1852
*
* Latitude and longitude must be in decimal degrees, x and y are in meters.
* The origin of the xy-grid is the intersection of the 0-degree meridian
* and the equator, where x is positive East and y is positive North.
*
* So, why the 1852? I'm using the (original) definition of a nautical mile
* here: 1 nautical mile = the length of one arcminute on the equator (hence
* the 60*1852; I'm converting the lat/lon degrees to lat/lon minutes).
*/
}
|
11025063-pizibing
|
poly2tri-examples-geotools/src/main/java/org/poly2tri/examples/geotools/WorldExample.java
|
Java
|
bsd
| 14,409
|
package org.poly2tri.geometry.primitives;
public abstract class Point
{
public abstract double getX();
public abstract double getY();
public abstract double getZ();
public abstract float getXf();
public abstract float getYf();
public abstract float getZf();
public abstract void set( double x, double y, double z );
protected static int calculateHashCode( double x, double y, double z)
{
int result = 17;
final long a = Double.doubleToLongBits(x);
result += 31 * result + (int) (a ^ (a >>> 32));
final long b = Double.doubleToLongBits(y);
result += 31 * result + (int) (b ^ (b >>> 32));
final long c = Double.doubleToLongBits(z);
result += 31 * result + (int) (c ^ (c >>> 32));
return result;
}
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/geometry/primitives/Point.java
|
Java
|
bsd
| 853
|
package org.poly2tri.geometry.primitives;
public abstract class Edge<A extends Point>
{
protected A p;
protected A q;
public A getP()
{
return p;
}
public A getQ()
{
return q;
}
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/geometry/primitives/Edge.java
|
Java
|
bsd
| 248
|
/* Poly2Tri
* Copyright (c) 2009-2010, Poly2Tri Contributors
* http://code.google.com/p/poly2tri/
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of Poly2Tri nor the names of its contributors may be
* used to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.poly2tri.geometry.polygon;
import java.util.ArrayList;
import java.util.List;
public class PolygonSet
{
protected ArrayList<Polygon> _polygons = new ArrayList<Polygon>();
public PolygonSet()
{
}
public PolygonSet( Polygon poly )
{
_polygons.add( poly );
}
public void add( Polygon p )
{
_polygons.add( p );
}
public List<Polygon> getPolygons()
{
return _polygons;
}
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/geometry/polygon/PolygonSet.java
|
Java
|
bsd
| 2,149
|
package org.poly2tri.geometry.polygon;
import org.poly2tri.triangulation.point.TPoint;
public class PolygonPoint extends TPoint
{
protected PolygonPoint _next;
protected PolygonPoint _previous;
public PolygonPoint( double x, double y )
{
super( x, y );
}
public PolygonPoint( double x, double y, double z )
{
super( x, y, z );
}
public void setPrevious( PolygonPoint p )
{
_previous = p;
}
public void setNext( PolygonPoint p )
{
_next = p;
}
public PolygonPoint getNext()
{
return _next;
}
public PolygonPoint getPrevious()
{
return _previous;
}
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/geometry/polygon/PolygonPoint.java
|
Java
|
bsd
| 728
|
package org.poly2tri.geometry.polygon;
public class PolygonUtil
{
/**
* TODO
* @param polygon
*/
public static void validate( Polygon polygon )
{
// TODO: implement
// 1. Check for duplicate points
// 2. Check for intersecting sides
}
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/geometry/polygon/PolygonUtil.java
|
Java
|
bsd
| 308
|
package org.poly2tri.geometry.polygon;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.poly2tri.triangulation.Triangulatable;
import org.poly2tri.triangulation.TriangulationContext;
import org.poly2tri.triangulation.TriangulationMode;
import org.poly2tri.triangulation.TriangulationPoint;
import org.poly2tri.triangulation.delaunay.DelaunayTriangle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Polygon implements Triangulatable
{
private final static Logger logger = LoggerFactory.getLogger( Polygon.class );
protected ArrayList<TriangulationPoint> _points = new ArrayList<TriangulationPoint>();
protected ArrayList<TriangulationPoint> _steinerPoints;
protected ArrayList<Polygon> _holes;
protected List<DelaunayTriangle> m_triangles;
protected PolygonPoint _last;
/**
* To create a polygon we need atleast 3 separate points
*
* @param p1
* @param p2
* @param p3
*/
public Polygon( PolygonPoint p1, PolygonPoint p2, PolygonPoint p3 )
{
p1._next = p2;
p2._next = p3;
p3._next = p1;
p1._previous = p3;
p2._previous = p1;
p3._previous = p2;
_points.add( p1 );
_points.add( p2 );
_points.add( p3 );
}
/**
* Requires atleast 3 points
* @param points - ordered list of points forming the polygon.
* No duplicates are allowed
*/
public Polygon( List<PolygonPoint> points )
{
// Lets do one sanity check that first and last point hasn't got same position
// Its something that often happen when importing polygon data from other formats
if( points.get(0).equals( points.get(points.size()-1) ) )
{
logger.warn( "Removed duplicate point");
points.remove( points.size()-1 );
}
_points.addAll( points );
}
/**
* Requires atleast 3 points
*
* @param points
*/
public Polygon( PolygonPoint[] points )
{
this( Arrays.asList( points ) );
}
public TriangulationMode getTriangulationMode()
{
return TriangulationMode.POLYGON;
}
public int pointCount()
{
int count = _points.size();
if( _steinerPoints != null )
{
count += _steinerPoints.size();
}
return count;
}
public void addSteinerPoint( TriangulationPoint point )
{
if( _steinerPoints == null )
{
_steinerPoints = new ArrayList<TriangulationPoint>();
}
_steinerPoints.add( point );
}
public void addSteinerPoints( List<TriangulationPoint> points )
{
if( _steinerPoints == null )
{
_steinerPoints = new ArrayList<TriangulationPoint>();
}
_steinerPoints.addAll( points );
}
public void clearSteinerPoints()
{
if( _steinerPoints != null )
{
_steinerPoints.clear();
}
}
/**
* Assumes: that given polygon is fully inside the current polygon
* @param poly - a subtraction polygon
*/
public void addHole( Polygon poly )
{
if( _holes == null )
{
_holes = new ArrayList<Polygon>();
}
_holes.add( poly );
// XXX: tests could be made here to be sure it is fully inside
// addSubtraction( poly.getPoints() );
}
/**
* Will insert a point in the polygon after given point
*
* @param a
* @param b
* @param p
*/
public void insertPointAfter( PolygonPoint a, PolygonPoint newPoint )
{
// Validate that
int index = _points.indexOf( a );
if( index != -1 )
{
newPoint.setNext( a.getNext() );
newPoint.setPrevious( a );
a.getNext().setPrevious( newPoint );
a.setNext( newPoint );
_points.add( index+1, newPoint );
}
else
{
throw new RuntimeException( "Tried to insert a point into a Polygon after a point not belonging to the Polygon" );
}
}
public void addPoints( List<PolygonPoint> list )
{
PolygonPoint first;
for( PolygonPoint p : list )
{
p.setPrevious( _last );
if( _last != null )
{
p.setNext( _last.getNext() );
_last.setNext( p );
}
_last = p;
_points.add( p );
}
first = (PolygonPoint)_points.get(0);
_last.setNext( first );
first.setPrevious( _last );
}
/**
* Will add a point after the last point added
*
* @param p
*/
public void addPoint(PolygonPoint p )
{
p.setPrevious( _last );
p.setNext( _last.getNext() );
_last.setNext( p );
_points.add( p );
}
public void removePoint( PolygonPoint p )
{
PolygonPoint next, prev;
next = p.getNext();
prev = p.getPrevious();
prev.setNext( next );
next.setPrevious( prev );
_points.remove( p );
}
public PolygonPoint getPoint()
{
return _last;
}
public List<TriangulationPoint> getPoints()
{
return _points;
}
public List<DelaunayTriangle> getTriangles()
{
return m_triangles;
}
public void addTriangle( DelaunayTriangle t )
{
m_triangles.add( t );
}
public void addTriangles( List<DelaunayTriangle> list )
{
m_triangles.addAll( list );
}
public void clearTriangulation()
{
if( m_triangles != null )
{
m_triangles.clear();
}
}
/**
* Creates constraints and populates the context with points
*/
public void prepareTriangulation( TriangulationContext<?> tcx )
{
if( m_triangles == null )
{
m_triangles = new ArrayList<DelaunayTriangle>( _points.size() );
}
else
{
m_triangles.clear();
}
// Outer constraints
for( int i = 0; i < _points.size()-1 ; i++ )
{
tcx.newConstraint( _points.get( i ), _points.get( i+1 ) );
}
tcx.newConstraint( _points.get( 0 ), _points.get( _points.size()-1 ) );
tcx.addPoints( _points );
// Hole constraints
if( _holes != null )
{
for( Polygon p : _holes )
{
for( int i = 0; i < p._points.size()-1 ; i++ )
{
tcx.newConstraint( p._points.get( i ), p._points.get( i+1 ) );
}
tcx.newConstraint( p._points.get( 0 ), p._points.get( p._points.size()-1 ) );
tcx.addPoints( p._points );
}
}
if( _steinerPoints != null )
{
tcx.addPoints( _steinerPoints );
}
}
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/geometry/polygon/Polygon.java
|
Java
|
bsd
| 7,329
|
package org.poly2tri.triangulation;
public abstract class TriangulationDebugContext
{
protected TriangulationContext<?> _tcx;
public TriangulationDebugContext( TriangulationContext<?> tcx )
{
_tcx = tcx;
}
public abstract void clear();
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/triangulation/TriangulationDebugContext.java
|
Java
|
bsd
| 290
|
package org.poly2tri.triangulation;
public enum TriangulationMode
{
UNCONSTRAINED,CONSTRAINED,POLYGON;
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/triangulation/TriangulationMode.java
|
Java
|
bsd
| 116
|
/* Poly2Tri
* Copyright (c) 2009-2010, Poly2Tri Contributors
* http://code.google.com/p/poly2tri/
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of Poly2Tri nor the names of its contributors may be
* used to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.poly2tri.triangulation.point;
import org.poly2tri.triangulation.TriangulationPoint;
public class TPoint extends TriangulationPoint
{
private double _x;
private double _y;
private double _z;
public TPoint( double x, double y )
{
this( x, y, 0 );
}
public TPoint( double x, double y, double z )
{
_x = x;
_y = y;
_z = z;
}
public double getX() { return _x; }
public double getY() { return _y; }
public double getZ() { return _z; }
public float getXf() { return (float)_x; }
public float getYf() { return (float)_y; }
public float getZf() { return (float)_z; }
@Override
public void set( double x, double y, double z )
{
_x = x;
_y = y;
_z = z;
}
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/triangulation/point/TPoint.java
|
Java
|
bsd
| 2,425
|
/* Poly2Tri
* Copyright (c) 2009-2010, Poly2Tri Contributors
* http://code.google.com/p/poly2tri/
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of Poly2Tri nor the names of its contributors may be
* used to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.poly2tri.triangulation.point;
import java.nio.FloatBuffer;
import org.poly2tri.triangulation.TriangulationPoint;
public class FloatBufferPoint extends TriangulationPoint
{
private final FloatBuffer _fb;
private final int _ix,_iy,_iz;
public FloatBufferPoint( FloatBuffer fb, int index )
{
_fb = fb;
_ix = index;
_iy = index+1;
_iz = index+2;
}
public final double getX()
{
return _fb.get( _ix );
}
public final double getY()
{
return _fb.get( _iy );
}
public final double getZ()
{
return _fb.get( _iz );
}
public final float getXf()
{
return _fb.get( _ix );
}
public final float getYf()
{
return _fb.get( _iy );
}
public final float getZf()
{
return _fb.get( _iz );
}
@Override
public void set( double x, double y, double z )
{
_fb.put( _ix, (float)x );
_fb.put( _iy, (float)y );
_fb.put( _iz, (float)z );
}
public static TriangulationPoint[] toPoints( FloatBuffer fb )
{
FloatBufferPoint[] points = new FloatBufferPoint[fb.limit()/3];
for( int i=0,j=0; i<points.length; i++, j+=3 )
{
points[i] = new FloatBufferPoint(fb, j);
}
return points;
}
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/triangulation/point/FloatBufferPoint.java
|
Java
|
bsd
| 3,083
|
/* Poly2Tri
* Copyright (c) 2009-2010, Poly2Tri Contributors
* http://code.google.com/p/poly2tri/
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of Poly2Tri nor the names of its contributors may be
* used to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.poly2tri.triangulation;
import java.util.ArrayList;
import java.util.List;
import org.poly2tri.triangulation.delaunay.DelaunayTriangle;
public abstract class TriangulationContext<A extends TriangulationDebugContext>
{
protected A _debug;
protected boolean _debugEnabled = false;
protected ArrayList<DelaunayTriangle> _triList = new ArrayList<DelaunayTriangle>();
protected ArrayList<TriangulationPoint> _points = new ArrayList<TriangulationPoint>(200);
protected TriangulationMode _triangulationMode;
protected Triangulatable _triUnit;
private boolean _terminated = false;
private boolean _waitUntilNotified;
private int _stepTime = -1;
private int _stepCount = 0;
public int getStepCount() { return _stepCount; }
public void done()
{
_stepCount++;
}
public abstract TriangulationAlgorithm algorithm();
public void prepareTriangulation( Triangulatable t )
{
_triUnit = t;
_triangulationMode = t.getTriangulationMode();
t.prepareTriangulation( this );
}
public abstract TriangulationConstraint newConstraint( TriangulationPoint a, TriangulationPoint b );
public void addToList( DelaunayTriangle triangle )
{
_triList.add( triangle );
}
public List<DelaunayTriangle> getTriangles()
{
return _triList;
}
public Triangulatable getTriangulatable()
{
return _triUnit;
}
public List<TriangulationPoint> getPoints()
{
return _points;
}
public synchronized void update(String message)
{
if( _debugEnabled )
{
try
{
synchronized( this )
{
_stepCount++;
if( _stepTime > 0 )
{
wait( (int)_stepTime );
/** Can we resume execution or are we expected to wait? */
if( _waitUntilNotified )
{
wait();
}
}
else
{
wait();
}
// We have been notified
_waitUntilNotified = false;
}
}
catch( InterruptedException e )
{
update("Triangulation was interrupted");
}
}
if( _terminated )
{
throw new RuntimeException( "Triangulation process terminated before completion");
}
}
public void clear()
{
_points.clear();
_terminated = false;
if( _debug != null )
{
_debug.clear();
}
_stepCount=0;
}
public TriangulationMode getTriangulationMode()
{
return _triangulationMode;
}
public synchronized void waitUntilNotified(boolean b)
{
_waitUntilNotified = b;
}
public void terminateTriangulation()
{
_terminated=true;
}
public boolean isDebugEnabled()
{
return _debugEnabled;
}
public abstract void isDebugEnabled( boolean b );
public A getDebugContext()
{
return _debug;
}
public void addPoints( List<TriangulationPoint> points )
{
_points.addAll( points );
}
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/triangulation/TriangulationContext.java
|
Java
|
bsd
| 5,244
|
package org.poly2tri.triangulation;
import java.util.List;
import org.poly2tri.triangulation.delaunay.DelaunayTriangle;
public interface Triangulatable
{
/**
* Preparations needed before triangulation start should be handled here
* @param tcx
*/
public void prepareTriangulation( TriangulationContext<?> tcx );
public List<DelaunayTriangle> getTriangles();
public List<TriangulationPoint> getPoints();
public void addTriangle( DelaunayTriangle t );
public void addTriangles( List<DelaunayTriangle> list );
public void clearTriangulation();
public TriangulationMode getTriangulationMode();
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/triangulation/Triangulatable.java
|
Java
|
bsd
| 673
|
/* Poly2Tri
* Copyright (c) 2009-2010, Poly2Tri Contributors
* http://code.google.com/p/poly2tri/
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of Poly2Tri nor the names of its contributors may be
* used to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.poly2tri.triangulation;
import java.util.ArrayList;
import org.poly2tri.geometry.primitives.Point;
import org.poly2tri.triangulation.delaunay.sweep.DTSweepConstraint;
public abstract class TriangulationPoint extends Point
{
// List of edges this point constitutes an upper ending point (CDT)
private ArrayList<DTSweepConstraint> edges;
@Override
public String toString()
{
return "[" + getX() + "," + getY() + "]";
}
public abstract double getX();
public abstract double getY();
public abstract double getZ();
public abstract float getXf();
public abstract float getYf();
public abstract float getZf();
public abstract void set( double x, double y, double z );
public ArrayList<DTSweepConstraint> getEdges()
{
return edges;
}
public void addEdge( DTSweepConstraint e )
{
if( edges == null )
{
edges = new ArrayList<DTSweepConstraint>();
}
edges.add( e );
}
public boolean hasEdges()
{
return edges != null;
}
/**
* @param p - edge destination point
* @return the edge from this point to given point
*/
public DTSweepConstraint getEdge( TriangulationPoint p )
{
for( DTSweepConstraint c : edges )
{
if( c.p == p )
{
return c;
}
}
return null;
}
public boolean equals(Object obj)
{
if( obj instanceof TriangulationPoint )
{
TriangulationPoint p = (TriangulationPoint)obj;
return getX() == p.getX() && getY() == p.getY();
}
return super.equals( obj );
}
public int hashCode()
{
long bits = java.lang.Double.doubleToLongBits(getX());
bits ^= java.lang.Double.doubleToLongBits(getY()) * 31;
return (((int) bits) ^ ((int) (bits >> 32)));
}
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/triangulation/TriangulationPoint.java
|
Java
|
bsd
| 3,694
|
/* Poly2Tri
* Copyright (c) 2009-2010, Poly2Tri Contributors
* http://code.google.com/p/poly2tri/
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of Poly2Tri nor the names of its contributors may be
* used to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.poly2tri.triangulation.delaunay;
import java.util.ArrayList;
import org.poly2tri.triangulation.TriangulationPoint;
import org.poly2tri.triangulation.delaunay.sweep.DTSweepConstraint;
import org.poly2tri.triangulation.point.TPoint;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class DelaunayTriangle
{
private final static Logger logger = LoggerFactory.getLogger( DelaunayTriangle.class );
/** Neighbor pointers */
public final DelaunayTriangle[] neighbors = new DelaunayTriangle[3];
/** Flags to determine if an edge is a Constrained edge */
public final boolean[] cEdge = new boolean[] { false, false, false };
/** Flags to determine if an edge is a Delauney edge */
public final boolean[] dEdge = new boolean[] { false, false, false };
/** Has this triangle been marked as an interior triangle? */
protected boolean interior = false;
public final TriangulationPoint[] points = new TriangulationPoint[3];
public DelaunayTriangle( TriangulationPoint p1, TriangulationPoint p2, TriangulationPoint p3 )
{
points[0] = p1;
points[1] = p2;
points[2] = p3;
}
public int index( TriangulationPoint p )
{
if( p == points[0] )
{
return 0;
}
else if( p == points[1] )
{
return 1;
}
else if( p == points[2] )
{
return 2;
}
throw new RuntimeException("Calling index with a point that doesn't exist in triangle");
}
public int indexCW( TriangulationPoint p )
{
int index = index(p);
switch( index )
{
case 0: return 2;
case 1: return 0;
default: return 1;
}
}
public int indexCCW( TriangulationPoint p )
{
int index = index(p);
switch( index )
{
case 0: return 1;
case 1: return 2;
default: return 0;
}
}
public boolean contains( TriangulationPoint p )
{
return ( p == points[0] || p == points[1] || p == points[2] );
}
public boolean contains( DTSweepConstraint e )
{
return ( contains( e.p ) && contains( e.q ) );
}
public boolean contains( TriangulationPoint p, TriangulationPoint q )
{
return ( contains( p ) && contains( q ) );
}
// Update neighbor pointers
private void markNeighbor( TriangulationPoint p1,
TriangulationPoint p2,
DelaunayTriangle t )
{
if( ( p1 == points[2] && p2 == points[1] ) || ( p1 == points[1] && p2 == points[2] ) )
{
neighbors[0] = t;
}
else if( ( p1 == points[0] && p2 == points[2] ) || ( p1 == points[2] && p2 == points[0] ) )
{
neighbors[1] = t;
}
else if( ( p1 == points[0] && p2 == points[1] ) || ( p1 == points[1] && p2 == points[0] ) )
{
neighbors[2] = t;
}
else
{
logger.error( "Neighbor error, please report!" );
// throw new Exception("Neighbor error, please report!");
}
}
/* Exhaustive search to update neighbor pointers */
public void markNeighbor( DelaunayTriangle t )
{
if( t.contains( points[1], points[2] ) )
{
neighbors[0] = t;
t.markNeighbor( points[1], points[2], this );
}
else if( t.contains( points[0], points[2] ) )
{
neighbors[1] = t;
t.markNeighbor( points[0], points[2], this );
}
else if( t.contains( points[0], points[1] ) )
{
neighbors[2] = t;
t.markNeighbor( points[0], points[1], this );
}
else
{
logger.error( "markNeighbor failed" );
}
}
public void clearNeighbors()
{
neighbors[0] = neighbors[1] = neighbors[2] = null;
}
public void clearNeighbor( DelaunayTriangle triangle )
{
if( neighbors[0] == triangle )
{
neighbors[0] = null;
}
else if( neighbors[1] == triangle )
{
neighbors[1] = null;
}
else
{
neighbors[2] = null;
}
}
/**
* Clears all references to all other triangles and points
*/
public void clear()
{
DelaunayTriangle t;
for( int i=0; i<3; i++ )
{
t = neighbors[i];
if( t != null )
{
t.clearNeighbor( this );
}
}
clearNeighbors();
points[0]=points[1]=points[2]=null;
}
/**
* @param t - opposite triangle
* @param p - the point in t that isn't shared between the triangles
* @return
*/
public TriangulationPoint oppositePoint( DelaunayTriangle t, TriangulationPoint p )
{
assert t != this : "self-pointer error";
return pointCW( t.pointCW(p) );
}
// The neighbor clockwise to given point
public DelaunayTriangle neighborCW( TriangulationPoint point )
{
if( point == points[0] )
{
return neighbors[1];
}
else if( point == points[1] )
{
return neighbors[2];
}
return neighbors[0];
}
// The neighbor counter-clockwise to given point
public DelaunayTriangle neighborCCW( TriangulationPoint point )
{
if( point == points[0] )
{
return neighbors[2];
}
else if( point == points[1] )
{
return neighbors[0];
}
return neighbors[1];
}
// The neighbor across to given point
public DelaunayTriangle neighborAcross( TriangulationPoint opoint )
{
if( opoint == points[0] )
{
return neighbors[0];
}
else if( opoint == points[1] )
{
return neighbors[1];
}
return neighbors[2];
}
// The point counter-clockwise to given point
public TriangulationPoint pointCCW( TriangulationPoint point )
{
if( point == points[0] )
{
return points[1];
}
else if( point == points[1] )
{
return points[2];
}
else if( point == points[2] )
{
return points[0];
}
logger.error( "point location error" );
throw new RuntimeException("[FIXME] point location error");
}
// The point counter-clockwise to given point
public TriangulationPoint pointCW( TriangulationPoint point )
{
if( point == points[0] )
{
return points[2];
}
else if( point == points[1] )
{
return points[0];
}
else if( point == points[2] )
{
return points[1];
}
logger.error( "point location error" );
throw new RuntimeException("[FIXME] point location error");
}
// Legalize triangle by rotating clockwise around oPoint
public void legalize( TriangulationPoint oPoint, TriangulationPoint nPoint )
{
if( oPoint == points[0] )
{
points[1] = points[0];
points[0] = points[2];
points[2] = nPoint;
}
else if( oPoint == points[1] )
{
points[2] = points[1];
points[1] = points[0];
points[0] = nPoint;
}
else if( oPoint == points[2] )
{
points[0] = points[2];
points[2] = points[1];
points[1] = nPoint;
}
else
{
logger.error( "legalization error" );
throw new RuntimeException("legalization bug");
}
}
public void printDebug()
{
System.out.println( points[0] + "," + points[1] + "," + points[2] );
}
// Finalize edge marking
public void markNeighborEdges()
{
for( int i = 0; i < 3; i++ )
{
if( cEdge[i] )
{
switch( i )
{
case 0:
if( neighbors[0] != null )
neighbors[0].markConstrainedEdge( points[1], points[2] );
break;
case 1:
if( neighbors[1] != null )
neighbors[1].markConstrainedEdge( points[0], points[2] );
break;
case 2:
if( neighbors[2] != null )
neighbors[2].markConstrainedEdge( points[0], points[1] );
break;
}
}
}
}
public void markEdge( DelaunayTriangle triangle )
{
for( int i = 0; i < 3; i++ )
{
if( cEdge[i] )
{
switch( i )
{
case 0:
triangle.markConstrainedEdge( points[1], points[2] );
break;
case 1:
triangle.markConstrainedEdge( points[0], points[2] );
break;
case 2:
triangle.markConstrainedEdge( points[0], points[1] );
break;
}
}
}
}
public void markEdge( ArrayList<DelaunayTriangle> tList )
{
for( DelaunayTriangle t : tList )
{
for( int i = 0; i < 3; i++ )
{
if( t.cEdge[i] )
{
switch( i )
{
case 0:
markConstrainedEdge( t.points[1], t.points[2] );
break;
case 1:
markConstrainedEdge( t.points[0], t.points[2] );
break;
case 2:
markConstrainedEdge( t.points[0], t.points[1] );
break;
}
}
}
}
}
public void markConstrainedEdge( int index )
{
cEdge[index] = true;
}
public void markConstrainedEdge( DTSweepConstraint edge )
{
markConstrainedEdge( edge.p, edge.q );
if( ( edge.q == points[0] && edge.p == points[1] )
|| ( edge.q == points[1] && edge.p == points[0] ) )
{
cEdge[2] = true;
}
else if( ( edge.q == points[0] && edge.p == points[2] )
|| ( edge.q == points[2] && edge.p == points[0] ) )
{
cEdge[1] = true;
}
else if( ( edge.q == points[1] && edge.p == points[2] )
|| ( edge.q == points[2] && edge.p == points[1] ) )
{
cEdge[0] = true;
}
}
// Mark edge as constrained
public void markConstrainedEdge( TriangulationPoint p, TriangulationPoint q )
{
if( ( q == points[0] && p == points[1] ) || ( q == points[1] && p == points[0] ) )
{
cEdge[2] = true;
}
else if( ( q == points[0] && p == points[2] ) || ( q == points[2] && p == points[0] ) )
{
cEdge[1] = true;
}
else if( ( q == points[1] && p == points[2] ) || ( q == points[2] && p == points[1] ) )
{
cEdge[0] = true;
}
}
public double area()
{
double a = (points[0].getX() - points[2].getX())*(points[1].getY() - points[0].getY());
double b = (points[0].getX() - points[1].getX())*(points[2].getY() - points[0].getY());
return 0.5*Math.abs( a - b );
}
public TPoint centroid()
{
double cx = ( points[0].getX() + points[1].getX() + points[2].getX() ) / 3d;
double cy = ( points[0].getY() + points[1].getY() + points[2].getY() ) / 3d;
return new TPoint( cx, cy );
}
/**
* Get the neighbor that share this edge
*
* @param constrainedEdge
* @return index of the shared edge or -1 if edge isn't shared
*/
public int edgeIndex( TriangulationPoint p1, TriangulationPoint p2 )
{
if( points[0] == p1 )
{
if( points[1] == p2 )
{
return 2;
}
else if( points[2] == p2 )
{
return 1;
}
}
else if( points[1] == p1 )
{
if( points[2] == p2 )
{
return 0;
}
else if( points[0] == p2 )
{
return 2;
}
}
else if( points[2] == p1 )
{
if( points[0] == p2 )
{
return 1;
}
else if( points[1] == p2 )
{
return 0;
}
}
return -1;
}
public boolean getConstrainedEdgeCCW( TriangulationPoint p )
{
if( p == points[0] )
{
return cEdge[2];
}
else if( p == points[1] )
{
return cEdge[0];
}
return cEdge[1];
}
public boolean getConstrainedEdgeCW( TriangulationPoint p )
{
if( p == points[0] )
{
return cEdge[1];
}
else if( p == points[1] )
{
return cEdge[2];
}
return cEdge[0];
}
public boolean getConstrainedEdgeAcross( TriangulationPoint p )
{
if( p == points[0] )
{
return cEdge[0];
}
else if( p == points[1] )
{
return cEdge[1];
}
return cEdge[2];
}
public void setConstrainedEdgeCCW( TriangulationPoint p, boolean ce )
{
if( p == points[0] )
{
cEdge[2] = ce;
}
else if( p == points[1] )
{
cEdge[0] = ce;
}
else
{
cEdge[1] = ce;
}
}
public void setConstrainedEdgeCW( TriangulationPoint p, boolean ce )
{
if( p == points[0] )
{
cEdge[1] = ce;
}
else if( p == points[1] )
{
cEdge[2] = ce;
}
else
{
cEdge[0] = ce;
}
}
public void setConstrainedEdgeAcross( TriangulationPoint p, boolean ce )
{
if( p == points[0] )
{
cEdge[0] = ce;
}
else if( p == points[1] )
{
cEdge[1] = ce;
}
else
{
cEdge[2] = ce;
}
}
public boolean getDelunayEdgeCCW( TriangulationPoint p )
{
if( p == points[0] )
{
return dEdge[2];
}
else if( p == points[1] )
{
return dEdge[0];
}
return dEdge[1];
}
public boolean getDelunayEdgeCW( TriangulationPoint p )
{
if( p == points[0] )
{
return dEdge[1];
}
else if( p == points[1] )
{
return dEdge[2];
}
return dEdge[0];
}
public boolean getDelunayEdgeAcross( TriangulationPoint p )
{
if( p == points[0] )
{
return dEdge[0];
}
else if( p == points[1] )
{
return dEdge[1];
}
return dEdge[2];
}
public void setDelunayEdgeCCW( TriangulationPoint p, boolean e )
{
if( p == points[0] )
{
dEdge[2] = e;
}
else if( p == points[1] )
{
dEdge[0] = e;
}
else
{
dEdge[1] = e;
}
}
public void setDelunayEdgeCW( TriangulationPoint p, boolean e )
{
if( p == points[0] )
{
dEdge[1] = e;
}
else if( p == points[1] )
{
dEdge[2] = e;
}
else
{
dEdge[0] = e;
}
}
public void setDelunayEdgeAcross( TriangulationPoint p, boolean e )
{
if( p == points[0] )
{
dEdge[0] = e;
}
else if( p == points[1] )
{
dEdge[1] = e;
}
else
{
dEdge[2] = e;
}
}
public void clearDelunayEdges()
{
dEdge[0] = false;
dEdge[1] = false;
dEdge[2] = false;
}
public boolean isInterior()
{
return interior;
}
public void isInterior( boolean b )
{
interior = b;
}
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/triangulation/delaunay/DelaunayTriangle.java
|
Java
|
bsd
| 18,530
|
/* Poly2Tri
* Copyright (c) 2009-2010, Poly2Tri Contributors
* http://code.google.com/p/poly2tri/
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of Poly2Tri nor the names of its contributors may be
* used to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.poly2tri.triangulation.delaunay.sweep;
import org.poly2tri.triangulation.TriangulationPoint;
import org.poly2tri.triangulation.delaunay.DelaunayTriangle;
public class AdvancingFrontNode
{
protected AdvancingFrontNode next = null;
protected AdvancingFrontNode prev = null;
protected final Double key; // XXX: BST
protected final double value;
protected final TriangulationPoint point;
protected DelaunayTriangle triangle;
public AdvancingFrontNode( TriangulationPoint point )
{
this.point = point;
value = point.getX();
key = Double.valueOf( value ); // XXX: BST
}
public AdvancingFrontNode getNext()
{
return next;
}
public AdvancingFrontNode getPrevious()
{
return prev;
}
public TriangulationPoint getPoint()
{
return point;
}
public DelaunayTriangle getTriangle()
{
return triangle;
}
public boolean hasNext()
{
return next != null;
}
public boolean hasPrevious()
{
return prev != null;
}
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/triangulation/delaunay/sweep/AdvancingFrontNode.java
|
Java
|
bsd
| 2,819
|
package org.poly2tri.triangulation.delaunay.sweep;
import org.poly2tri.triangulation.TriangulationContext;
import org.poly2tri.triangulation.TriangulationDebugContext;
import org.poly2tri.triangulation.TriangulationPoint;
import org.poly2tri.triangulation.delaunay.DelaunayTriangle;
public class DTSweepDebugContext extends TriangulationDebugContext
{
/*
* Fields used for visual representation of current triangulation
*/
protected DelaunayTriangle _primaryTriangle;
protected DelaunayTriangle _secondaryTriangle;
protected TriangulationPoint _activePoint;
protected AdvancingFrontNode _activeNode;
protected DTSweepConstraint _activeConstraint;
public DTSweepDebugContext( DTSweepContext tcx )
{
super( tcx );
}
public boolean isDebugContext()
{
return true;
}
// private Tuple2<TPoint,Double> m_circumCircle = new Tuple2<TPoint,Double>( new TPoint(), new Double(0) );
// public Tuple2<TPoint,Double> getCircumCircle() { return m_circumCircle; }
public DelaunayTriangle getPrimaryTriangle()
{
return _primaryTriangle;
}
public DelaunayTriangle getSecondaryTriangle()
{
return _secondaryTriangle;
}
public AdvancingFrontNode getActiveNode()
{
return _activeNode;
}
public DTSweepConstraint getActiveConstraint()
{
return _activeConstraint;
}
public TriangulationPoint getActivePoint()
{
return _activePoint;
}
public void setPrimaryTriangle( DelaunayTriangle triangle )
{
_primaryTriangle = triangle;
_tcx.update("setPrimaryTriangle");
}
public void setSecondaryTriangle( DelaunayTriangle triangle )
{
_secondaryTriangle = triangle;
_tcx.update("setSecondaryTriangle");
}
public void setActivePoint( TriangulationPoint point )
{
_activePoint = point;
}
public void setActiveConstraint( DTSweepConstraint e )
{
_activeConstraint = e;
_tcx.update("setWorkingSegment");
}
public void setActiveNode( AdvancingFrontNode node )
{
_activeNode = node;
_tcx.update("setWorkingNode");
}
@Override
public void clear()
{
_primaryTriangle = null;
_secondaryTriangle = null;
_activePoint = null;
_activeNode = null;
_activeConstraint = null;
}
// public void setWorkingCircumCircle( TPoint point, TPoint point2, TPoint point3 )
// {
// double dx,dy;
//
// CircleXY.circumCenter( point, point2, point3, m_circumCircle.a );
// dx = m_circumCircle.a.getX()-point.getX();
// dy = m_circumCircle.a.getY()-point.getY();
// m_circumCircle.b = Double.valueOf( Math.sqrt( dx*dx + dy*dy ) );
//
// }
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/triangulation/delaunay/sweep/DTSweepDebugContext.java
|
Java
|
bsd
| 3,002
|
package org.poly2tri.triangulation.delaunay.sweep;
import java.util.Comparator;
import org.poly2tri.triangulation.TriangulationPoint;
public class DTSweepPointComparator implements Comparator<TriangulationPoint>
{
public int compare( TriangulationPoint p1, TriangulationPoint p2 )
{
if(p1.getY() < p2.getY() )
{
return -1;
}
else if( p1.getY() > p2.getY())
{
return 1;
}
else
{
if(p1.getX() < p2.getX())
{
return -1;
}
else if( p1.getX() > p2.getX() )
{
return 1;
}
else
{
return 0;
}
}
}
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/triangulation/delaunay/sweep/DTSweepPointComparator.java
|
Java
|
bsd
| 760
|
package org.poly2tri.triangulation.delaunay.sweep;
public class PointOnEdgeException extends RuntimeException
{
/**
*
*/
private static final long serialVersionUID = 1L;
public PointOnEdgeException( String msg )
{
super(msg);
}
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/triangulation/delaunay/sweep/PointOnEdgeException.java
|
Java
|
bsd
| 287
|
package org.poly2tri.triangulation.delaunay.sweep;
public class AdvancingFrontIndex<A>
{
double _min,_max;
IndexNode<A> _root;
public AdvancingFrontIndex( double min, double max, int depth )
{
if( depth > 5 ) depth = 5;
_root = createIndex( depth );
}
private IndexNode<A> createIndex( int n )
{
IndexNode<A> node = null;
if( n > 0 )
{
node = new IndexNode<A>();
node.bigger = createIndex( n-1 );
node.smaller = createIndex( n-1 );
}
return node;
}
public A fetchAndRemoveIndex( A key )
{
return null;
}
public A fetchAndInsertIndex( A key )
{
return null;
}
class IndexNode<A>
{
A value;
IndexNode<A> smaller;
IndexNode<A> bigger;
double range;
}
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/triangulation/delaunay/sweep/AdvancingFrontIndex.java
|
Java
|
bsd
| 919
|
/* Poly2Tri
* Copyright (c) 2009-2010, Poly2Tri Contributors
* http://code.google.com/p/poly2tri/
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of Poly2Tri nor the names of its contributors may be
* used to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.poly2tri.triangulation;
public enum TriangulationAlgorithm
{
DTSweep
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/triangulation/TriangulationAlgorithm.java
|
Java
|
bsd
| 1,745
|
/* Poly2Tri
* Copyright (c) 2009-2010, Poly2Tri Contributors
* http://code.google.com/p/poly2tri/
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of Poly2Tri nor the names of its contributors may be
* used to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.poly2tri.triangulation;
public enum TriangulationProcessEvent
{
Started,Waiting,Failed,Aborted,Done
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/triangulation/TriangulationProcessEvent.java
|
Java
|
bsd
| 1,776
|
/* Poly2Tri
* Copyright (c) 2009-2010, Poly2Tri Contributors
* http://code.google.com/p/poly2tri/
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of Poly2Tri nor the names of its contributors may be
* used to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.poly2tri.triangulation.sets;
import java.util.ArrayList;
import java.util.List;
import org.poly2tri.triangulation.Triangulatable;
import org.poly2tri.triangulation.TriangulationContext;
import org.poly2tri.triangulation.TriangulationMode;
import org.poly2tri.triangulation.TriangulationPoint;
import org.poly2tri.triangulation.delaunay.DelaunayTriangle;
public class PointSet implements Triangulatable
{
List<TriangulationPoint> _points;
List<DelaunayTriangle> _triangles;
public PointSet( List<TriangulationPoint> points )
{
_points = new ArrayList<TriangulationPoint>();
_points.addAll( points );
}
public TriangulationMode getTriangulationMode()
{
return TriangulationMode.UNCONSTRAINED;
}
public List<TriangulationPoint> getPoints()
{
return _points;
}
public List<DelaunayTriangle> getTriangles()
{
return _triangles;
}
public void addTriangle( DelaunayTriangle t )
{
_triangles.add( t );
}
public void addTriangles( List<DelaunayTriangle> list )
{
_triangles.addAll( list );
}
public void clearTriangulation()
{
_triangles.clear();
}
public void prepareTriangulation( TriangulationContext<?> tcx )
{
if( _triangles == null )
{
_triangles = new ArrayList<DelaunayTriangle>( _points.size() );
}
else
{
_triangles.clear();
}
tcx.addPoints( _points );
}
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/triangulation/sets/PointSet.java
|
Java
|
bsd
| 3,309
|
/* Poly2Tri
* Copyright (c) 2009-2010, Poly2Tri Contributors
* http://code.google.com/p/poly2tri/
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of Poly2Tri nor the names of its contributors may be
* used to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.poly2tri.triangulation.util;
public class Tuple2<A,B>
{
public A a;
public B b;
public Tuple2(A a,B b)
{
this.a = a;
this.b = b;
}
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/triangulation/util/Tuple2.java
|
Java
|
bsd
| 1,851
|
/* Poly2Tri
* Copyright (c) 2009-2010, Poly2Tri Contributors
* http://code.google.com/p/poly2tri/
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of Poly2Tri nor the names of its contributors may be
* used to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.poly2tri.triangulation.util;
public class Tuple3<A,B,C>
{
public A a;
public B b;
public C c;
public Tuple3(A a,B b,C c)
{
this.a = a;
this.b = b;
this.c = c;
}
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/triangulation/util/Tuple3.java
|
Java
|
bsd
| 1,895
|
/* Poly2Tri
* Copyright (c) 2009-2010, Poly2Tri Contributors
* http://code.google.com/p/poly2tri/
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of Poly2Tri nor the names of its contributors may be
* used to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.poly2tri.triangulation.util;
import org.poly2tri.geometry.polygon.Polygon;
import org.poly2tri.geometry.polygon.PolygonPoint;
public class PolygonGenerator
{
private static final double PI_2 = 2.0*Math.PI;
public static Polygon RandomCircleSweep( double scale, int vertexCount )
{
PolygonPoint point;
PolygonPoint[] points;
double radius = scale/4;
points = new PolygonPoint[vertexCount];
for(int i=0; i<vertexCount; i++)
{
do
{
if( i%250 == 0 )
{
radius += scale/2*(0.5 - Math.random());
}
else if( i%50 == 0 )
{
radius += scale/5*(0.5 - Math.random());
}
else
{
radius += 25*scale/vertexCount*(0.5 - Math.random());
}
radius = radius > scale/2 ? scale/2 : radius;
radius = radius < scale/10 ? scale/10 : radius;
} while( radius < scale/10 || radius > scale/2 );
point = new PolygonPoint( radius*Math.cos( (PI_2*i)/vertexCount ),
radius*Math.sin( (PI_2*i)/vertexCount ) );
points[i] = point;
}
return new Polygon( points );
}
public static Polygon RandomCircleSweep2( double scale, int vertexCount )
{
PolygonPoint point;
PolygonPoint[] points;
double radius = scale/4;
points = new PolygonPoint[vertexCount];
for(int i=0; i<vertexCount; i++)
{
do
{
radius += scale/5*(0.5 - Math.random());
radius = radius > scale/2 ? scale/2 : radius;
radius = radius < scale/10 ? scale/10 : radius;
} while( radius < scale/10 || radius > scale/2 );
point = new PolygonPoint( radius*Math.cos( (PI_2*i)/vertexCount ),
radius*Math.sin( (PI_2*i)/vertexCount ) );
points[i] = point;
}
return new Polygon( points );
}
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/triangulation/util/PolygonGenerator.java
|
Java
|
bsd
| 3,982
|
package org.poly2tri.triangulation.util;
import java.util.ArrayList;
import java.util.List;
import org.poly2tri.triangulation.TriangulationPoint;
import org.poly2tri.triangulation.point.TPoint;
public class PointGenerator
{
public static List<TriangulationPoint> uniformDistribution( int n, double scale )
{
ArrayList<TriangulationPoint> points = new ArrayList<TriangulationPoint>();
for( int i=0; i<n; i++ )
{
points.add( new TPoint( scale*(0.5 - Math.random()), scale*(0.5 - Math.random()) ) );
}
return points;
}
public static List<TriangulationPoint> uniformGrid( int n, double scale )
{
double x=0;
double size = scale/n;
double halfScale = 0.5*scale;
ArrayList<TriangulationPoint> points = new ArrayList<TriangulationPoint>();
for( int i=0; i<n+1; i++ )
{
x = halfScale - i*size;
for( int j=0; j<n+1; j++ )
{
points.add( new TPoint( x, halfScale - j*size ) );
}
}
return points;
}
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/triangulation/util/PointGenerator.java
|
Java
|
bsd
| 1,157
|
/* Poly2Tri
* Copyright (c) 2009-2010, Poly2Tri Contributors
* http://code.google.com/p/poly2tri/
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of Poly2Tri nor the names of its contributors may be
* used to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.poly2tri.triangulation;
public interface TriangulationProcessListener
{
public void triangulationEvent( TriangulationProcessEvent e, Triangulatable unit );
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/triangulation/TriangulationProcessListener.java
|
Java
|
bsd
| 1,832
|
package org.poly2tri.transform.coordinate;
/**
* A transform that aligns the XY plane normal [0,0,1] with any given target normal
*
* http://www.cs.brown.edu/~jfh/papers/Moller-EBA-1999/paper.pdf
*
* @author thahlen@gmail.com
*
*/
public class XYToAnyTransform extends Matrix3Transform
{
/**
* Assumes target normal is normalized
*/
public XYToAnyTransform( double nx, double ny, double nz )
{
setTargetNormal( nx, ny, nz );
}
/**
* Assumes target normal is normalized
*
* @param nx
* @param ny
* @param nz
*/
public void setTargetNormal( double nx, double ny, double nz )
{
double h,f,c,vx,vy,hvx;
vx = ny;
vy = -nx;
c = nz;
h = (1-c)/(1-c*c);
hvx = h*vx;
f = (c < 0) ? -c : c;
if( f < 1.0 - 1.0E-4 )
{
m00=c + hvx*vx;
m01=hvx*vy;
m02=-vy;
m10=hvx*vy;
m11=c + h*vy*vy;
m12=vx;
m20=vy;
m21=-vx;
m22=c;
}
else
{
// if "from" and "to" vectors are nearly parallel
m00=1;
m01=0;
m02=0;
m10=0;
m11=1;
m12=0;
m20=0;
m21=0;
if( c > 0 )
{
m22=1;
}
else
{
m22=-1;
}
}
}
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/transform/coordinate/XYToAnyTransform.java
|
Java
|
bsd
| 1,615
|
package org.poly2tri.transform.coordinate;
import java.util.List;
import org.poly2tri.geometry.primitives.Point;
public class NoTransform implements CoordinateTransform
{
public void transform( Point p, Point store )
{
store.set( p.getX(), p.getY(), p.getZ() );
}
public void transform( Point p )
{
}
public void transform( List<? extends Point> list )
{
}
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/transform/coordinate/NoTransform.java
|
Java
|
bsd
| 429
|
package org.poly2tri.transform.coordinate;
/**
* A transform that aligns given source normal with the XY plane normal [0,0,1]
*
* @author thahlen@gmail.com
*/
public class AnyToXYTransform extends Matrix3Transform
{
/**
* Assumes source normal is normalized
*/
public AnyToXYTransform( double nx, double ny, double nz )
{
setSourceNormal( nx, ny, nz );
}
/**
* Assumes source normal is normalized
*
* @param nx
* @param ny
* @param nz
*/
public void setSourceNormal( double nx, double ny, double nz )
{
double h,f,c,vx,vy,hvx;
vx = -ny;
vy = nx;
c = nz;
h = (1-c)/(1-c*c);
hvx = h*vx;
f = (c < 0) ? -c : c;
if( f < 1.0 - 1.0E-4 )
{
m00=c + hvx*vx;
m01=hvx*vy;
m02=-vy;
m10=hvx*vy;
m11=c + h*vy*vy;
m12=vx;
m20=vy;
m21=-vx;
m22=c;
}
else
{
// if "from" and "to" vectors are nearly parallel
m00=1;
m01=0;
m02=0;
m10=0;
m11=1;
m12=0;
m20=0;
m21=0;
if( c > 0 )
{
m22=1;
}
else
{
m22=-1;
}
}
}
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/transform/coordinate/AnyToXYTransform.java
|
Java
|
bsd
| 1,544
|
package org.poly2tri.transform.coordinate;
import java.util.List;
import org.poly2tri.geometry.primitives.Point;
public abstract class Matrix3Transform implements CoordinateTransform
{
protected double m00,m01,m02,m10,m11,m12,m20,m21,m22;
public void transform( Point p, Point store )
{
final double px = p.getX();
final double py = p.getY();
final double pz = p.getZ();
store.set(m00 * px + m01 * py + m02 * pz,
m10 * px + m11 * py + m12 * pz,
m20 * px + m21 * py + m22 * pz );
}
public void transform( Point p )
{
final double px = p.getX();
final double py = p.getY();
final double pz = p.getZ();
p.set(m00 * px + m01 * py + m02 * pz,
m10 * px + m11 * py + m12 * pz,
m20 * px + m21 * py + m22 * pz );
}
public void transform( List<? extends Point> list )
{
for( Point p : list )
{
transform( p );
}
}
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/transform/coordinate/Matrix3Transform.java
|
Java
|
bsd
| 1,054
|
package org.poly2tri.transform.coordinate;
import java.util.List;
import org.poly2tri.geometry.primitives.Point;
public abstract interface CoordinateTransform
{
public abstract void transform( Point p, Point store );
public abstract void transform( Point p );
public abstract void transform( List<? extends Point> list );
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/transform/coordinate/CoordinateTransform.java
|
Java
|
bsd
| 351
|
/* Poly2Tri
* Copyright (c) 2009-2010, Poly2Tri Contributors
* http://code.google.com/p/poly2tri/
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of Poly2Tri nor the names of its contributors may be
* used to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.poly2tri;
import org.poly2tri.geometry.polygon.Polygon;
import org.poly2tri.geometry.polygon.PolygonSet;
import org.poly2tri.triangulation.Triangulatable;
import org.poly2tri.triangulation.TriangulationAlgorithm;
import org.poly2tri.triangulation.TriangulationContext;
import org.poly2tri.triangulation.TriangulationMode;
import org.poly2tri.triangulation.TriangulationProcess;
import org.poly2tri.triangulation.delaunay.sweep.DTSweep;
import org.poly2tri.triangulation.delaunay.sweep.DTSweepContext;
import org.poly2tri.triangulation.sets.ConstrainedPointSet;
import org.poly2tri.triangulation.sets.PointSet;
import org.poly2tri.triangulation.util.PolygonGenerator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Poly2Tri
{
private final static Logger logger = LoggerFactory.getLogger( Poly2Tri.class );
private static final TriangulationAlgorithm _defaultAlgorithm = TriangulationAlgorithm.DTSweep;
public static void triangulate( PolygonSet ps )
{
TriangulationContext<?> tcx = createContext( _defaultAlgorithm );
for( Polygon p : ps.getPolygons() )
{
tcx.prepareTriangulation( p );
triangulate( tcx );
tcx.clear();
}
}
public static void triangulate( Polygon p )
{
triangulate( _defaultAlgorithm, p );
}
public static void triangulate( ConstrainedPointSet cps )
{
triangulate( _defaultAlgorithm, cps );
}
public static void triangulate( PointSet ps )
{
triangulate( _defaultAlgorithm, ps );
}
public static TriangulationContext<?> createContext( TriangulationAlgorithm algorithm )
{
switch( algorithm )
{
case DTSweep:
default:
return new DTSweepContext();
}
}
public static void triangulate( TriangulationAlgorithm algorithm,
Triangulatable t )
{
TriangulationContext<?> tcx;
// long time = System.nanoTime();
tcx = createContext( algorithm );
tcx.prepareTriangulation( t );
triangulate( tcx );
// logger.info( "Triangulation of {} points [{}ms]", tcx.getPoints().size(), ( System.nanoTime() - time ) / 1e6 );
}
public static void triangulate( TriangulationContext<?> tcx )
{
switch( tcx.algorithm() )
{
case DTSweep:
default:
DTSweep.triangulate( (DTSweepContext)tcx );
}
}
/**
* Will do a warmup run to let the JVM optimize the triangulation code
*/
public static void warmup()
{
/*
* After a method is run 10000 times, the Hotspot compiler will compile
* it into native code. Periodically, the Hotspot compiler may recompile
* the method. After an unspecified amount of time, then the compilation
* system should become quiet.
*/
Polygon poly = PolygonGenerator.RandomCircleSweep2( 50, 50000 );
TriangulationProcess process = new TriangulationProcess();
process.triangulate( poly );
}
}
|
11025063-pizibing
|
poly2tri-core/src/main/java/org/poly2tri/Poly2Tri.java
|
Java
|
bsd
| 4,971
|
/***************************************
*
* Android Bluetooth Oscilloscope
* yus - projectproto.blogspot.com
* September 2010
*
***************************************/
package org.projectproto.yuscope;
import android.graphics.Canvas;
import android.view.SurfaceHolder;
public class WaveformPlotThread extends Thread {
private SurfaceHolder holder;
private WaveformView plot_area;
private boolean _run = false;
public WaveformPlotThread(SurfaceHolder surfaceHolder, WaveformView view){
holder = surfaceHolder;
plot_area = view;
}
public void setRunning(boolean run){
_run = run;
}
@Override
public void run(){
Canvas c;
while(_run){
c = null;
try{
c = holder.lockCanvas(null);
synchronized (holder) {
plot_area.PlotPoints(c);
}
}finally{
if(c!=null){
holder.unlockCanvasAndPost(c);
}
}
}
}
}
|
116str-blueosci
|
AndroidBluetoothOscilloscope/src/org/projectproto/yuscope/WaveformPlotThread.java
|
Java
|
asf20
| 873
|
/***************************************
*
* Android Bluetooth Oscilloscope
* yus - projectproto.blogspot.com
* September 2010
*
***************************************/
package org.projectproto.yuscope;
import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.PowerManager;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.ToggleButton;
public class BluetoothOscilloscope extends Activity implements Button.OnClickListener{
// Message types sent from the BluetoothRfcommClient Handler
public static final int MESSAGE_STATE_CHANGE = 1;
public static final int MESSAGE_READ = 2;
public static final int MESSAGE_WRITE = 3;
public static final int MESSAGE_DEVICE_NAME = 4;
public static final int MESSAGE_TOAST = 5;
// Key names received from the BluetoothRfcommClient Handler
public static final String DEVICE_NAME = "device_name";
public static final String TOAST = "toast";
// Intent request codes
private static final int REQUEST_CONNECT_DEVICE = 1;
private static final int REQUEST_ENABLE_BT = 2;
// bt-uart constants
private static final int MAX_SAMPLES = 640;
private static final int MAX_LEVEL = 240;
private static final int DATA_START = (MAX_LEVEL + 1);
private static final int DATA_END = (MAX_LEVEL + 2);
private static final byte REQ_DATA = 0x00;
private static final byte ADJ_HORIZONTAL = 0x01;
private static final byte ADJ_VERTICAL = 0x02;
private static final byte ADJ_POSITION = 0x03;
private static final byte CHANNEL1 = 0x01;
private static final byte CHANNEL2 = 0x02;
// Run/Pause status
private boolean bReady = false;
// receive data
private int[] ch1_data = new int[MAX_SAMPLES/2];
private int[] ch2_data = new int[MAX_SAMPLES/2];
private int dataIndex=0, dataIndex1=0, dataIndex2=0;
private boolean bDataAvailable=false;
// Layout Views
private TextView mBTStatus;
private Button mConnectButton;
private RadioButton rb1, rb2;
private TextView ch1pos_label, ch2pos_label;
private Button btn_pos_up, btn_pos_down;
private TextView ch1_scale, ch2_scale;
private Button btn_scale_up, btn_scale_down;
private TextView time_per_div;
private Button timebase_inc, timebase_dec;
private ToggleButton run_buton;
public WaveformView mWaveform = null;
// Name of the connected device
private String mConnectedDeviceName = null;
// Local Bluetooth adapter
private BluetoothAdapter mBluetoothAdapter = null;
// Member object for the RFCOMM services
private BluetoothRfcommClient mRfcommClient = null;
static String[] timebase = {"5us", "10us", "20us", "50us", "100us", "200us", "500us", "1ms", "2ms", "5ms", "10ms", "20ms", "50ms" };
static String[] ampscale = {"10mV", "20mV", "50mV", "100mV", "200mV", "500mV", "1V", "2V", "GND"};
static byte timebase_index = 5;
static byte ch1_index = 4, ch2_index = 5;
static byte ch1_pos = 24, ch2_pos = 17; // 0 to 40
// stay awake
protected PowerManager.WakeLock mWakeLock;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Set up the window layout
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.main);
// Get local Bluetooth adapter
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
// If the adapter is null, then Bluetooth is not supported
if (mBluetoothAdapter == null) {
Toast.makeText(this, "Bluetooth is not available", Toast.LENGTH_LONG).show();
finish();
return;
}
// Prevent phone from sleeping
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
this.mWakeLock = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, "My Tag");
this.mWakeLock.acquire();
}
@Override
public void onStart(){
super.onStart();
// If BT is not on, request that it be enabled.
if (!mBluetoothAdapter.isEnabled()){
Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableIntent, REQUEST_ENABLE_BT);
}
// Otherwise, setup the Oscillosope session
else{
if (mRfcommClient == null) setupOscilloscope();
}
}
@Override
public synchronized void onResume(){
super.onResume();
// Performing this check in onResume() covers the case in which BT was
// not enabled during onStart(), so we were paused to enable it...
// onResume() will be called when ACTION_REQUEST_ENABLE activity returns.
if (mRfcommClient != null) {
// Only if the state is STATE_NONE, do we know that we haven't started already
if (mRfcommClient.getState() == BluetoothRfcommClient.STATE_NONE) {
// Start the Bluetooth RFCOMM services
mRfcommClient.start();
}
}
}
@Override
public void onClick(View v){
int buttonID;
buttonID = v.getId();
switch (buttonID){
case R.id.btn_position_up :
if(rb1.isChecked() && (ch1_pos<38) ){
ch1_pos += 1; ch1pos_label.setPadding(0, toScreenPos(ch1_pos), 0, 0);
sendMessage( new String(new byte[] {ADJ_POSITION, CHANNEL1, ch1_pos}) );
}
else if(rb2.isChecked() && (ch2_pos<38) ){
ch2_pos += 1; ch2pos_label.setPadding(0, toScreenPos(ch2_pos), 0, 0);
sendMessage( new String(new byte[] {ADJ_POSITION, CHANNEL2, ch2_pos}) );
}
break;
case R.id.btn_position_down :
if(rb1.isChecked() && (ch1_pos>4) ){
ch1_pos -= 1; ch1pos_label.setPadding(0, toScreenPos(ch1_pos), 0, 0);
sendMessage( new String(new byte[] {ADJ_POSITION, CHANNEL1, ch1_pos}) );
}
else if(rb2.isChecked() && (ch2_pos>4) ){
ch2_pos -= 1; ch2pos_label.setPadding(0, toScreenPos(ch2_pos), 0, 0);
sendMessage( new String(new byte[] {ADJ_POSITION, CHANNEL2, ch2_pos}) );
}
break;
case R.id.btn_scale_increase :
if(rb1.isChecked() && (ch1_index>0)){
ch1_scale.setText(ampscale[--ch1_index]);
sendMessage( new String(new byte[] {ADJ_VERTICAL, CHANNEL1, ch1_index}) );
}
else if(rb2.isChecked() && (ch2_index>0)){
ch2_scale.setText(ampscale[--ch2_index]);
sendMessage( new String(new byte[] {ADJ_VERTICAL, CHANNEL2, ch2_index}) );
}
break;
case R.id.btn_scale_decrease :
if(rb1.isChecked() && (ch1_index<(ampscale.length-1))){
ch1_scale.setText(ampscale[++ch1_index]);
sendMessage( new String(new byte[] {ADJ_VERTICAL, CHANNEL1, ch1_index}) );
}
else if(rb2.isChecked() && (ch2_index<(ampscale.length-1))){
ch2_scale.setText(ampscale[++ch2_index]);
sendMessage( new String(new byte[] {ADJ_VERTICAL, CHANNEL2, ch2_index}) );
}
break;
case R.id.btn_timebase_increase :
if(timebase_index<(timebase.length-1)){
time_per_div.setText(timebase[++timebase_index]);
sendMessage( new String(new byte[] {ADJ_HORIZONTAL, timebase_index}) );
}
break;
case R.id.btn_timebase_decrease :
if(timebase_index>0){
time_per_div.setText(timebase[--timebase_index]);
sendMessage( new String(new byte[] {ADJ_HORIZONTAL, timebase_index}) );
}
break;
case R.id.tbtn_runtoggle :
if(run_buton.isChecked()){
sendMessage( new String(new byte[] {
ADJ_HORIZONTAL, timebase_index,
ADJ_VERTICAL, CHANNEL1, ch1_index,
ADJ_VERTICAL, CHANNEL2, ch2_index,
ADJ_POSITION, CHANNEL1, ch1_pos,
ADJ_POSITION, CHANNEL2, ch2_pos,
REQ_DATA}) );
bReady = true;
}else{
bReady = false;
}
break;
}
}
@Override
public void onDestroy(){
super.onDestroy();
// Stop the Bluetooth RFCOMM services
if (mRfcommClient != null) mRfcommClient.stop();
// release screen being on
if (mWakeLock.isHeld()) {
mWakeLock.release();
}
}
/**
* Sends a message.
* @param message A string of text to send.
*/
private void sendMessage(String message){
// Check that we're actually connected before trying anything
if (mRfcommClient.getState() != BluetoothRfcommClient.STATE_CONNECTED) {
Toast.makeText(this, R.string.not_connected, Toast.LENGTH_SHORT).show();
return;
}
// Check that there's actually something to send
if (message.length() > 0) {
// Get the message bytes and tell the BluetoothRfcommClient to write
byte[] send = message.getBytes();
mRfcommClient.write(send);
}
}
private void setupOscilloscope(){
mBTStatus = (TextView) findViewById(R.id.txt_btstatus);
mConnectButton = (Button) findViewById(R.id.button_connect);
mConnectButton.setOnClickListener(new OnClickListener(){
public void onClick(View arg0) {
BTConnect();
}
});
rb1 = (RadioButton)findViewById(R.id.rbtn_ch1);
rb2 = (RadioButton)findViewById(R.id.rbtn_ch2);
ch1pos_label = (TextView) findViewById(R.id.txt_ch1pos);
ch2pos_label = (TextView) findViewById(R.id.txt_ch2pos);
ch1pos_label.setPadding(0, toScreenPos(ch1_pos), 0, 0);
ch2pos_label.setPadding(0, toScreenPos(ch2_pos), 0, 0);
btn_pos_up = (Button) findViewById(R.id.btn_position_up);
btn_pos_down = (Button) findViewById(R.id.btn_position_down);
btn_pos_up.setOnClickListener(this);
btn_pos_down.setOnClickListener(this);
ch1_scale = (TextView) findViewById(R.id.txt_ch1_scale);
ch2_scale = (TextView) findViewById(R.id.txt_ch2_scale);
ch1_scale.setText(ampscale[ch1_index]);
ch2_scale.setText(ampscale[ch2_index]);
btn_scale_up = (Button) findViewById(R.id.btn_scale_increase);
btn_scale_down = (Button) findViewById(R.id.btn_scale_decrease);
btn_scale_up.setOnClickListener(this);
btn_scale_down.setOnClickListener(this);
time_per_div = (TextView)findViewById(R.id.txt_timebase);
time_per_div.setText(timebase[timebase_index]);
timebase_inc = (Button) findViewById(R.id.btn_timebase_increase);
timebase_dec = (Button) findViewById(R.id.btn_timebase_decrease);
timebase_inc.setOnClickListener(this);
timebase_dec.setOnClickListener(this);
run_buton = (ToggleButton) findViewById(R.id.tbtn_runtoggle);
run_buton.setOnClickListener(this);
// Initialize the BluetoothRfcommClient to perform bluetooth connections
mRfcommClient = new BluetoothRfcommClient(this, mHandler);
// waveform / plot area
mWaveform = (WaveformView)findViewById(R.id.WaveformArea);
}
private void BTConnect(){
Intent serverIntent = new Intent(this, DeviceListActivity.class);
startActivityForResult(serverIntent, REQUEST_CONNECT_DEVICE);
}
private int toScreenPos(byte position){
//return ( (int)MAX_LEVEL - (int)position*6 );
return ( (int)MAX_LEVEL - (int)position*6 - 7);
}
// The Handler that gets information back from the BluetoothRfcommClient
private final Handler mHandler = new Handler(){
@Override
public void handleMessage(Message msg){
switch (msg.what){
case MESSAGE_STATE_CHANGE:
switch (msg.arg1){
case BluetoothRfcommClient.STATE_CONNECTED:
mBTStatus.setText(R.string.title_connected_to);
mBTStatus.append("\n" + mConnectedDeviceName);
break;
case BluetoothRfcommClient.STATE_CONNECTING:
mBTStatus.setText(R.string.title_connecting);
break;
case BluetoothRfcommClient.STATE_NONE:
mBTStatus.setText(R.string.title_not_connected);
break;
}
break;
case MESSAGE_READ: // todo: implement receive data buffering
byte[] readBuf = (byte[]) msg.obj;
int data_length = msg.arg1;
for(int x=0; x<data_length; x++){
int raw = UByte(readBuf[x]);
if( raw>MAX_LEVEL ){
if( raw==DATA_START ){
bDataAvailable = true;
dataIndex = 0; dataIndex1=0; dataIndex2=0;
}
else if( (raw==DATA_END) || (dataIndex>=MAX_SAMPLES) ){
bDataAvailable = false;
dataIndex = 0; dataIndex1=0; dataIndex2=0;
mWaveform.set_data(ch1_data, ch2_data);
if(bReady){ // send "REQ_DATA" again
BluetoothOscilloscope.this.sendMessage( new String(new byte[] {REQ_DATA}) );
}
//break;
}
}
else if( (bDataAvailable) && (dataIndex<(MAX_SAMPLES)) ){ // valid data
if((dataIndex++)%2==0) ch1_data[dataIndex1++] = raw; // even data
else ch2_data[dataIndex2++] = raw; // odd data
}
}
break;
case MESSAGE_DEVICE_NAME:
// save the connected device's name
mConnectedDeviceName = msg.getData().getString(DEVICE_NAME);
Toast.makeText(getApplicationContext(), "Connected to "
+ mConnectedDeviceName, Toast.LENGTH_SHORT).show();
break;
case MESSAGE_TOAST:
Toast.makeText(getApplicationContext(), msg.getData().getString(TOAST),
Toast.LENGTH_SHORT).show();
break;
}
}
// signed to unsigned
private int UByte(byte b){
if(b<0) // if negative
return (int)( (b&0x7F) + 128 );
else
return (int)b;
}
};
public void onActivityResult(int requestCode, int resultCode, Intent data){
switch (requestCode) {
case REQUEST_CONNECT_DEVICE:
// When DeviceListActivity returns with a device to connect
if (resultCode == Activity.RESULT_OK){
// Get the device MAC address
String address = data.getExtras().getString(DeviceListActivity.EXTRA_DEVICE_ADDRESS);
// Get the BLuetoothDevice object
BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address);
// Attempt to connect to the device
mRfcommClient.connect(device);
}
break;
case REQUEST_ENABLE_BT:
// When the request to enable Bluetooth returns
if (resultCode == Activity.RESULT_OK){
// Bluetooth is now enabled, so set up the oscilloscope
setupOscilloscope();
}else{
// User did not enable Bluetooth or an error occured
Toast.makeText(this, R.string.bt_not_enabled_leaving, Toast.LENGTH_SHORT).show();
finish();
}
break;
}
}
}
|
116str-blueosci
|
AndroidBluetoothOscilloscope/src/org/projectproto/yuscope/BluetoothOscilloscope.java
|
Java
|
asf20
| 15,481
|
/***************************************
*
* Android Bluetooth Oscilloscope
* yus - projectproto.blogspot.com
* September 2010
*
***************************************/
package org.projectproto.yuscope;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.UUID;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothSocket;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
/**
*
**/
public class BluetoothRfcommClient {
// Unique UUID for this application
private static final UUID MY_UUID =
//UUID.fromString("fa87c0d0-afac-11de-8a39-0800200c9a66");
UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
// Member fields
private final BluetoothAdapter mAdapter;
private final Handler mHandler;
private ConnectThread mConnectThread;
private ConnectedThread mConnectedThread;
private int mState;
// Constants that indicate the current connection state
public static final int STATE_NONE = 0; // we're doing nothing
//public static final int STATE_LISTEN = 1; // now listening for incoming connections
public static final int STATE_CONNECTING = 2; // now initiating an outgoing connection
public static final int STATE_CONNECTED = 3; // now connected to a remote device
/**
* Constructor. Prepares a new BluetoothChat session.
* - context - The UI Activity Context
* - handler - A Handler to send messages back to the UI Activity
*/
public BluetoothRfcommClient(Context context, Handler handler) {
mAdapter = BluetoothAdapter.getDefaultAdapter();
mState = STATE_NONE;
mHandler = handler;
}
/**
* Set the current state o
* */
private synchronized void setState(int state) {
mState = state;
// Give the new state to the Handler so the UI Activity can update
mHandler.obtainMessage(BluetoothOscilloscope.MESSAGE_STATE_CHANGE, state, -1).sendToTarget();
}
/**
* Return the current connection state. */
public synchronized int getState() {
return mState;
}
/**
* Start the Rfcomm client service.
* */
public synchronized void start() {
// Cancel any thread attempting to make a connection
if (mConnectThread != null) {mConnectThread.cancel(); mConnectThread = null;}
// Cancel any thread currently running a connection
if (mConnectedThread != null) {mConnectedThread.cancel(); mConnectedThread = null;}
setState(STATE_NONE);
}
/**
* Start the ConnectThread to initiate a connection to a remote device.
* - device - The BluetoothDevice to connect
*/
public synchronized void connect(BluetoothDevice device) {
// Cancel any thread attempting to make a connection
if (mState == STATE_CONNECTING) {
if (mConnectThread != null) {mConnectThread.cancel(); mConnectThread = null;}
}
// Cancel any thread currently running a connection
if (mConnectedThread != null) {mConnectedThread.cancel(); mConnectedThread = null;}
// Start the thread to connect with the given device
mConnectThread = new ConnectThread(device);
mConnectThread.start();
setState(STATE_CONNECTING);
}
/**
* Start the ConnectedThread to begin managing a Bluetooth connection
* - socket - The BluetoothSocket on which the connection was made
* - device - The BluetoothDevice that has been connected
*/
public synchronized void connected(BluetoothSocket socket, BluetoothDevice device) {
// Cancel the thread that completed the connection
if (mConnectThread != null) {mConnectThread.cancel(); mConnectThread = null;}
// Cancel any thread currently running a connection
if (mConnectedThread != null) {mConnectedThread.cancel(); mConnectedThread = null;}
// Start the thread to manage the connection and perform transmissions
mConnectedThread = new ConnectedThread(socket);
mConnectedThread.start();
// Send the name of the connected device back to the UI Activity
Message msg = mHandler.obtainMessage(BluetoothOscilloscope.MESSAGE_DEVICE_NAME);
Bundle bundle = new Bundle();
bundle.putString(BluetoothOscilloscope.DEVICE_NAME, device.getName());
msg.setData(bundle);
mHandler.sendMessage(msg);
setState(STATE_CONNECTED);
}
/**
* Stop all threads
*/
public synchronized void stop() {
if (mConnectThread != null) {mConnectThread.cancel(); mConnectThread = null;}
if (mConnectedThread != null) {mConnectedThread.cancel(); mConnectedThread = null;}
setState(STATE_NONE);
}
/**
* Write to the ConnectedThread in an unsynchronized manner
* - out - The bytes to write - ConnectedThread#write(byte[])
*/
public void write(byte[] out) {
// Create temporary object
ConnectedThread r;
// Synchronize a copy of the ConnectedThread
synchronized (this) {
if (mState != STATE_CONNECTED) return;
r = mConnectedThread;
}
// Perform the write unsynchronized
r.write(out);
}
/**
* Indicate that the connection attempt failed and notify the UI Activity.
*/
private void connectionFailed() {
setState(STATE_NONE);
// Send a failure message back to the Activity
Message msg = mHandler.obtainMessage(BluetoothOscilloscope.MESSAGE_TOAST);
Bundle bundle = new Bundle();
bundle.putString(BluetoothOscilloscope.TOAST, "Unable to connect device");
msg.setData(bundle);
mHandler.sendMessage(msg);
}
/**
* Indicate that the connection was lost and notify the UI Activity.
*/
private void connectionLost() {
setState(STATE_NONE);
// Send a failure message back to the Activity
Message msg = mHandler.obtainMessage(BluetoothOscilloscope.MESSAGE_TOAST);
Bundle bundle = new Bundle();
bundle.putString(BluetoothOscilloscope.TOAST, "Device connection was lost");
msg.setData(bundle);
mHandler.sendMessage(msg);
}
/**
* This thread runs while attempting to make an outgoing connection
* with a device. It runs straight through; the connection either
* succeeds or fails.
*/
private class ConnectThread extends Thread {
private final BluetoothSocket mmSocket;
private final BluetoothDevice mmDevice;
public ConnectThread(BluetoothDevice device) {
mmDevice = device;
BluetoothSocket tmp = null;
// Get a BluetoothSocket for a connection with the given BluetoothDevice
try {
tmp = device.createRfcommSocketToServiceRecord(MY_UUID);
} catch (IOException e) {
//
}
mmSocket = tmp;
}
public void run() {
setName("ConnectThread");
// Always cancel discovery because it will slow down a connection
mAdapter.cancelDiscovery();
// Make a connection to the BluetoothSocket
try {
// This is a blocking call and will only return on a successful connection or an exception
mmSocket.connect();
} catch (IOException e) {
connectionFailed();
// Close the socket
try {
mmSocket.close();
} catch (IOException e2) {
//
}
// Start the service over to restart listening mode
BluetoothRfcommClient.this.start();
return;
}
// Reset the ConnectThread because we're done
synchronized (BluetoothRfcommClient.this) {
mConnectThread = null;
}
// Start the connected thread
connected(mmSocket, mmDevice);
}
public void cancel() {
try {
mmSocket.close();
} catch (IOException e) {
//
}
}
}
/**
* This thread runs during a connection with a remote device.
* It handles all incoming and outgoing transmissions.
*/
private class ConnectedThread extends Thread {
private final BluetoothSocket mmSocket;
private final InputStream mmInStream;
private final OutputStream mmOutStream;
public ConnectedThread(BluetoothSocket socket) {
mmSocket = socket;
InputStream tmpIn = null;
OutputStream tmpOut = null;
// Get the BluetoothSocket input and output streams
try {
tmpIn = socket.getInputStream();
tmpOut = socket.getOutputStream();
} catch (IOException e) {
}
mmInStream = tmpIn;
mmOutStream = tmpOut;
}
public void run() {
byte[] buffer = new byte[1024];
int bytes;
// Keep listening to the InputStream while connected
while (true) {
try {
// Read from the InputStream
bytes = mmInStream.read(buffer);
// Send the obtained bytes to the UI Activity
mHandler.obtainMessage(BluetoothOscilloscope.MESSAGE_READ, bytes, -1, buffer)
.sendToTarget();
} catch (IOException e) {
//
connectionLost();
break;
}
}
}
/**
* Write to the connected OutStream.
*/
public void write(byte[] buffer) {
try {
mmOutStream.write(buffer);
// Share the sent message back to the UI Activity
mHandler.obtainMessage(BluetoothOscilloscope.MESSAGE_WRITE, -1, -1, buffer)
.sendToTarget();
} catch (IOException e) {
//
}
}
public void cancel() {
try {
mmSocket.close();
} catch (IOException e) {
//
}
}
}
}
|
116str-blueosci
|
AndroidBluetoothOscilloscope/src/org/projectproto/yuscope/BluetoothRfcommClient.java
|
Java
|
asf20
| 10,507
|
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.projectproto.yuscope;
import java.util.Set;
import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.AdapterView.OnItemClickListener;
/**
* This Activity appears as a dialog. It lists any paired devices and
* devices detected in the area after discovery. When a device is chosen
* by the user, the MAC address of the device is sent back to the parent
* Activity in the result Intent.
*/
public class DeviceListActivity extends Activity {
// Return Intent extra
public static String EXTRA_DEVICE_ADDRESS = "device_address";
// Member fields
private BluetoothAdapter mBtAdapter;
private ArrayAdapter<String> mPairedDevicesArrayAdapter;
private ArrayAdapter<String> mNewDevicesArrayAdapter;
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
// Setup the window
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setContentView(R.layout.device_list);
// Set result CANCELED incase the user backs out
setResult(Activity.RESULT_CANCELED);
// Initialize the button to perform device discovery
Button scanButton = (Button) findViewById(R.id.button_scan);
scanButton.setOnClickListener(new OnClickListener(){
public void onClick(View v){
doDiscovery();
v.setVisibility(View.GONE);
}
});
// Initialize array adapters. One for already paired devices and
// one for newly discovered devices
mPairedDevicesArrayAdapter = new ArrayAdapter<String>(this, R.layout.device_name);
mNewDevicesArrayAdapter = new ArrayAdapter<String>(this, R.layout.device_name);
// Find and set up the ListView for paired devices
ListView pairedListView = (ListView) findViewById(R.id.paired_devices);
pairedListView.setAdapter(mPairedDevicesArrayAdapter);
pairedListView.setOnItemClickListener(mDeviceClickListener);
// Find and set up the ListView for newly discovered devices
ListView newDevicesListView = (ListView) findViewById(R.id.new_devices);
newDevicesListView.setAdapter(mNewDevicesArrayAdapter);
newDevicesListView.setOnItemClickListener(mDeviceClickListener);
// Register for broadcasts when a device is discovered
IntentFilter filter = new IntentFilter(BluetoothDevice.ACTION_FOUND);
this.registerReceiver(mReceiver, filter);
// Register for broadcasts when discovery has finished
filter = new IntentFilter(BluetoothAdapter.ACTION_DISCOVERY_FINISHED);
this.registerReceiver(mReceiver, filter);
// Get the local Bluetooth adapter
mBtAdapter = BluetoothAdapter.getDefaultAdapter();
// Get a set of currently paired devices
Set<BluetoothDevice> pairedDevices = mBtAdapter.getBondedDevices();
// If there are paired devices, add each one to the ArrayAdapter
if (pairedDevices.size() > 0){
findViewById(R.id.title_paired_devices).setVisibility(View.VISIBLE);
for (BluetoothDevice device : pairedDevices){
mPairedDevicesArrayAdapter.add(device.getName() + "\n" + device.getAddress());
}
}else{
String noDevices = getResources().getText(R.string.none_paired).toString();
mPairedDevicesArrayAdapter.add(noDevices);
}
}
@Override
protected void onDestroy(){
super.onDestroy();
// Make sure we're not doing discovery anymore
if (mBtAdapter != null) {
mBtAdapter.cancelDiscovery();
}
// Unregister broadcast listeners
this.unregisterReceiver(mReceiver);
}
/**
* Start device discover with the BluetoothAdapter
*/
private void doDiscovery(){
// Indicate scanning in the title
setProgressBarIndeterminateVisibility(true);
setTitle(R.string.scanning);
// Turn on sub-title for new devices
findViewById(R.id.title_new_devices).setVisibility(View.VISIBLE);
// If we're already discovering, stop it
if (mBtAdapter.isDiscovering()) {
mBtAdapter.cancelDiscovery();
}
// Request discover from BluetoothAdapter
mBtAdapter.startDiscovery();
}
// The on-click listener for all devices in the ListViews
private OnItemClickListener mDeviceClickListener = new OnItemClickListener(){
public void onItemClick(AdapterView<?> av, View v, int arg2, long arg3){
// Cancel discovery because it's costly and we're about to connect
mBtAdapter.cancelDiscovery();
// Get the device MAC address, which is the last 17 chars in the View
String info = ((TextView) v).getText().toString();
String address = info.substring(info.length() - 17);
// Create the result Intent and include the MAC address
Intent intent = new Intent();
intent.putExtra(EXTRA_DEVICE_ADDRESS, address);
// Set result and finish this Activity
setResult(Activity.RESULT_OK, intent);
finish();
}
};
// The BroadcastReceiver that listens for discovered devices and
// changes the title when discovery is finished
private final BroadcastReceiver mReceiver = new BroadcastReceiver(){
@Override
public void onReceive(Context context, Intent intent){
String action = intent.getAction();
// When discovery finds a device
if (BluetoothDevice.ACTION_FOUND.equals(action)){
// Get the BluetoothDevice object from the Intent
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
// If it's already paired, skip it, because it's been listed already
if (device.getBondState() != BluetoothDevice.BOND_BONDED){
mNewDevicesArrayAdapter.add(device.getName() + "\n" + device.getAddress());
}
}
// When discovery is finished, change the Activity title
else if (BluetoothAdapter.ACTION_DISCOVERY_FINISHED.equals(action)){
setProgressBarIndeterminateVisibility(false);
setTitle(R.string.select_device);
if (mNewDevicesArrayAdapter.getCount() == 0){
String noDevices = getResources().getText(R.string.none_found).toString();
mNewDevicesArrayAdapter.add(noDevices);
}
}
}
};
}
|
116str-blueosci
|
AndroidBluetoothOscilloscope/src/org/projectproto/yuscope/DeviceListActivity.java
|
Java
|
asf20
| 7,793
|
/***************************************
*
* Android Bluetooth Oscilloscope
* yus - projectproto.blogspot.com
* September 2010
*
***************************************/
package org.projectproto.yuscope;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
public class WaveformView extends SurfaceView implements SurfaceHolder.Callback{
// plot area size
private final static int WIDTH = 320;
private final static int HEIGHT = 240;
private static int[] ch1_data = new int[WIDTH];
private static int[] ch2_data = new int[WIDTH];
private static int ch1_pos = 100; //HEIGHT/2;
private static int ch2_pos = 140; //HEIGHT/2;
private WaveformPlotThread plot_thread;
private Paint ch1_color = new Paint();
private Paint ch2_color = new Paint();
private Paint grid_paint = new Paint();
private Paint cross_paint = new Paint();
private Paint outline_paint = new Paint();
public WaveformView(Context context, AttributeSet attrs){
super(context, attrs);
getHolder().addCallback(this);
// initial values
for(int x=0; x<WIDTH; x++){
ch1_data[x] = ch1_pos;
ch2_data[x] = ch2_pos;
}
plot_thread = new WaveformPlotThread(getHolder(), this);
ch1_color.setColor(Color.YELLOW);
ch2_color.setColor(Color.RED);
grid_paint.setColor(Color.rgb(100, 100, 100));
cross_paint.setColor(Color.rgb(70, 100, 70));
outline_paint.setColor(Color.GREEN);
}
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height){
}
@Override
public void surfaceCreated(SurfaceHolder holder){
plot_thread.setRunning(true);
plot_thread.start();
}
@Override
public void surfaceDestroyed(SurfaceHolder holder){
boolean retry = true;
plot_thread.setRunning(false);
while (retry){
try{
plot_thread.join();
retry = false;
}catch(InterruptedException e){
}
}
}
@Override
public void onDraw(Canvas canvas){
PlotPoints(canvas);
}
public void set_data(int[] data1, int[] data2 ){
plot_thread.setRunning(false);
for(int x=0; x<WIDTH; x++){
// channel 1
if(x<(data1.length)){
ch1_data[x] = HEIGHT-data1[x]+1;
}else{
ch1_data[x] = ch1_pos;
}
// channel 2
if(x<(data1.length)){
ch2_data[x] = HEIGHT-data2[x]+1;
}else{
ch2_data[x] = ch2_pos;
}
}
plot_thread.setRunning(true);
}
public void PlotPoints(Canvas canvas){
// clear screen
canvas.drawColor(Color.rgb(20, 20, 20));
// draw vertical grids
for(int vertical = 1; vertical<10; vertical++){
canvas.drawLine(
vertical*(WIDTH/10)+1, 1,
vertical*(WIDTH/10)+1, HEIGHT+1,
grid_paint);
}
// draw horizontal grids
for(int horizontal = 1; horizontal<10; horizontal++){
canvas.drawLine(
1, horizontal*(HEIGHT/10)+1,
WIDTH+1, horizontal*(HEIGHT/10)+1,
grid_paint);
}
// draw outline
canvas.drawLine(0, 0, (WIDTH+1), 0, outline_paint); // top
canvas.drawLine((WIDTH+1), 0, (WIDTH+1), (HEIGHT+1), outline_paint); //right
canvas.drawLine(0, (HEIGHT+1), (WIDTH+1), (HEIGHT+1), outline_paint); // bottom
canvas.drawLine(0, 0, 0, (HEIGHT+1), outline_paint); //left
// plot data
for(int x=0; x<(WIDTH-1); x++){
canvas.drawLine(x+1, ch2_data[x], x+2, ch2_data[x+1], ch2_color);
canvas.drawLine(x+1, ch1_data[x], x+2, ch1_data[x+1], ch1_color);
}
}
}
|
116str-blueosci
|
AndroidBluetoothOscilloscope/src/org/projectproto/yuscope/WaveformView.java
|
Java
|
asf20
| 3,558
|
#ifndef _TIMER_H_
#define _TIMER_H_
#define FCY 40000000 // 40MIPS
#define SAMPLES_PER_DIV 32
#define PERIOD_5us (unsigned int)(FCY * 5E-6 / SAMPLES_PER_DIV ) // 6
#define PERIOD_10us (unsigned int)(FCY * 10E-6 / SAMPLES_PER_DIV ) // 12
#define PERIOD_20us (unsigned int)(FCY * 20E-6 / SAMPLES_PER_DIV )
#define PERIOD_50us (unsigned int)(FCY * 50E-6 / SAMPLES_PER_DIV )
#define PERIOD_100us (unsigned int)(FCY * 100E-6 / SAMPLES_PER_DIV )
#define PERIOD_200us (unsigned int)(FCY * 200E-6 / SAMPLES_PER_DIV )
#define PERIOD_500us (unsigned int)(FCY * 500E-6 / SAMPLES_PER_DIV )
#define PERIOD_1ms (unsigned int)(FCY * 1E-3 / SAMPLES_PER_DIV )
#define PERIOD_2ms (unsigned int)(FCY * 2E-3 / SAMPLES_PER_DIV )
#define PERIOD_5ms (unsigned int)(FCY * 5E-3 / SAMPLES_PER_DIV )
#define PERIOD_10ms (unsigned int)(FCY * 10E-3 / SAMPLES_PER_DIV ) // 12500
#define PERIOD_20ms (unsigned int)(FCY * 20E-3 / SAMPLES_PER_DIV )
#define PERIOD_50ms (unsigned int)(FCY * 50E-3 / SAMPLES_PER_DIV ) // 62500
extern volatile unsigned int sampling_period;
extern const unsigned int PERIODS[];
extern void timer1_init(void);
extern void set_sampling_period(unsigned int period);
#endif // _TIMER_H_
|
116str-blueosci
|
RemoteDevice/dsPIC Bluetooth Oscilloscope/timer.h
|
C
|
asf20
| 1,227
|
#include "p33fxxxx.h"
#include "adc.h"
#include "timer.h"
volatile unsigned int adc_value_1;
volatile unsigned int adc_value_2;
volatile unsigned int raw_data[MAX_SAMPLES];
volatile unsigned int samples_count;
const long VOLT_PER_DIV[]={
SCALE_10mV,
SCALE_20mV,
SCALE_50mV,
SCALE_100mV,
SCALE_200mV,
SCALE_500mV,
SCALE_1V,
SCALE_2V,
SCALE_GND
};
void adc_init(void)
{
ADCONbits.ADON = 0; // Temporarily Turn off ADC to allow for initialization settings
aux_pll_init();
ADCONbits.FORM = 0; // Output in Integer Format
ADCONbits.EIE = 1; // Enable Early Interrupt (7TAD)
//ADCONbits.ORDER = 0; // Normal Order of conversion
//ADCONbits.SEQSAMP = 0; // Simultaneous sampling
ADCONbits.ASYNCSAMP = 1; // Asynchronous sampling
ADCONbits.SLOWCLK = 0; // High Frequency Clock input (use aux pll)
ADCONbits.ADCS = 0; //5; // Clock divider selection
ADCPC1bits.TRGSRC2 = 0b01100; // Timer1 period match (trigger source)
ADPCFGbits.PCFG4 = 0; // AN4 is configured as analog input
ADPCFGbits.PCFG5 = 0; // AN5 is configured as analog input
IPC28bits.ADCP2IP = 0x01; // Set ADC Pair 2 Interrupt Priority (Level 1)
IFS7bits.ADCP2IF = 0; // Clear ADC Pair 2 Interrupt Flag
//IEC7bits.ADCP2IE = 1; // Enable ADC Pair 2 Interrupt
ADCONbits.ADON = 1; // Enable ADC module
}
/* ADC Pair 2 ISR*/
void __attribute__((interrupt, no_auto_psv)) _ADCP2Interrupt (void)
{
raw_data[samples_count++] = ADCBUF4; // Read AN4 conversion result;
raw_data[samples_count++] = ADCBUF5; // Read AN5 conversion result;
IFS7bits.ADCP2IF = 0; // Clear ADC Pair 2 Interrupt Flag
}
void store_raw_data(void)
{
unsigned int total_samples;
total_samples = get_total_samples();
samples_count = 0; // reset counter
//IEC0bits.U1RXIE = 0; // disable RX interrupt
IEC7bits.ADCP2IE = 1; // enable ADC Pair 2 Interrupt
TMR1 = 0x0000; // reset timer 1
T1CONbits.TON = 1; // Starts 16-bit Timer1
while(samples_count<total_samples); // wait until samples are completed
IEC7bits.ADCP2IE = 0; // disable ADC Pair 2 Interrupt
T1CONbits.TON = 0; // Stops 16-bit Timer1
//IEC0bits.U1RXIE = 1; // Enable RX interrupt
}
unsigned int get_total_samples(void)
{
if(sampling_period==PERIOD_5us)
return (MAX_SAMPLES/4);
else if(sampling_period==PERIOD_10us)
return (MAX_SAMPLES/2);
else
return (MAX_SAMPLES);
}
void aux_pll_init(void)
{
ACLKCONbits.FRCSEL = 1; // Internal FRC is clock source for auxiliary PLL
ACLKCONbits.ENAPLL = 1; // APLL is enabled
ACLKCONbits.SELACLK = 1; // Auxiliary PLL provides the source clock for the clock divider
ACLKCONbits.APSTSCLR = 7; // Auxiliary Clock Output Divider is Divide by 1
while(ACLKCONbits.APLLCK != 1){}; // Wait for Auxiliary PLL to Lock
}
|
116str-blueosci
|
RemoteDevice/dsPIC Bluetooth Oscilloscope/adc.c
|
C
|
asf20
| 2,805
|
/************************************
Bluetooth Oscilloscope
yus - projectproto.blogspot.com
September 2010
*************************************/
#include "main.h"
_FOSCSEL(FNOSC_FRC); // Select Internal FRC at POR
_FOSC(FCKSM_CSECMD & OSCIOFNC_OFF); // Enable Clock Switching and Configure
_FICD(ICS_PGD1 & JTAGEN_OFF);
int main(void)
{
unsigned char c;
osc_init();
port_init();
ser_init();
adc_init();
timer1_init();
//initial values;
ch1_position = 120;
ch2_position = 120;
ch1_gain = VOLT_PER_DIV[4];
ch2_gain = VOLT_PER_DIV[5];
while(1)
{
if(ser_isrx()){
led_off();
c = ser_getch(); //get 1 character from receive buffer
switch(c){
case REQ_DATA:
store_raw_data();
ser_putch(DATA_START);
send_data();
ser_putch(DATA_END);
break;
case ADJ_HORIZONTAL:
c = ser_getch();
if( (c<13) ){
set_sampling_period( PERIODS[c] ); // refer to "timer.h"
}
break;
case ADJ_VERTICAL:
c = ser_getch();
if(c==CHANNEL1) ch1_gain = VOLT_PER_DIV[ser_getch()]; // refer to "adc.h"
else if(c==CHANNEL2) ch2_gain = VOLT_PER_DIV[ser_getch()];
break;
case ADJ_POSITION:
c = ser_getch();
if(c==CHANNEL1) ch1_position = (long)ser_getch() * 6;
else if(c==CHANNEL2) ch2_position = (long)ser_getch() * 6;
break;
default:
break;
} // switch(command)
led_on();
}//if-ser_isrx()
}//while-true
}
void osc_init(void)
{
// Configure PLL prescaler, PLL postscaler, PLL divisor
PLLFBD = 41; // M = 43
CLKDIVbits.PLLPOST=0; // N1 = 2
CLKDIVbits.PLLPRE=0; // N2 = 2
// Initiate Clock Switch to Internal FRC with PLL (NOSC = 0b001)
__builtin_write_OSCCONH(0x01);
__builtin_write_OSCCONL(0x01);
// Wait for Clock switch to occur
while (OSCCONbits.COSC != 0b001);
// Wait for PLL to lock
while(OSCCONbits.LOCK!=1) {};
}
void port_init(void)
{
// LED Pin Configuration:I/O Port RC3; pin 5
PORTCbits.RC3 = 0; // Configure as Output
TRISCbits.TRISC3 = 0; // Configure as Output
LATCbits.LATC3 = 1; // Initialize to zero
RPINR18bits.U1RXR = 28; //RX -> pin 20 (RP28)
RPOR13bits.RP27R = 0b00011; //TX -> pin 19 (RP27)
ADPCFGbits.PCFG4 = 0; // AN4 is configured as analog input
ADPCFGbits.PCFG5 = 0; // AN5 is configured as analog input
}
void send_data(void)
{
#define bits 10
unsigned int i, total;
unsigned int repeat, n;
unsigned char plot_data1, plot_data2;
signed long temp;
total = get_total_samples();
repeat = MAX_SAMPLES / total;
i=0;
while( i<total )
{
/*** CHANNEL 1 ***/
// refer to "adc.xmcd" (mathcad) for the computation
temp = (ch1_position<<bits) / (long)MAX_LEVEL;
temp = (long)OFFSET1 + temp - (long)raw_data[i++];
temp = temp * (long)MAX_LEVEL * ch1_gain;
temp = (temp>>bits) + (ch1_position<<2) - (ch1_position*ch1_gain);
temp = temp>>2;
plot_data1 = clamp_value( temp );
/*** CHANNEL 2 ***/
temp = (ch2_position<<bits) / (long)MAX_LEVEL;
temp = (long)OFFSET2 + temp - (long)raw_data[i++];
temp = temp * (long)MAX_LEVEL * ch2_gain;
temp = (temp>>bits) + (ch2_position<<2) - (ch2_position*ch2_gain);
temp = temp>>2;
plot_data2 = clamp_value( temp );
n=repeat;
while(n--){
ser_putch( plot_data1 );
ser_putch( plot_data2 );
}
}
}
unsigned char clamp_value(long value)
{
if(value<0)
return 0;
else if (value>(long)MAX_LEVEL)
return ((unsigned char) MAX_LEVEL);
else
return (unsigned char) value;
}
|
116str-blueosci
|
RemoteDevice/dsPIC Bluetooth Oscilloscope/main.c
|
C
|
asf20
| 3,588
|
#define _SER_C_
#include "p33fxxxx.h"
#include "ser.h"
unsigned char txfifo[SER_BUFFER_SIZE];
volatile unsigned char txiptr, txoptr;
unsigned char rxfifo[SER_BUFFER_SIZE];
volatile unsigned char rxiptr, rxoptr;
unsigned char ser_tmp;
void ser_init(void)
{
//RPINR18bits.U1RXR = 28; //RX -> pin 20 (RP28)
//RPOR13bits.RP27R = 0b00011; //TX -> pin 19 (RP27)
U1MODEbits.STSEL = 0; // 1-stop bit
U1MODEbits.PDSEL = 0; // No Parity, 8-data bits
U1MODEbits.ABAUD = 0; // Auto-Baud Disabled
U1MODEbits.BRGH = 1; //High-Speed mode
U1BRG = BRGVAL; // BAUD Rate Setting
U1STAbits.UTXISEL0 = 0; // Interrupt after one Tx character is transmitted
U1STAbits.UTXISEL1 = 0;
U1STAbits.URXISEL = 0b00; // Interrupt after one RX character is received;
IEC0bits.U1RXIE = 1; //Enable RX interrupt
U1MODEbits.UARTEN = 1; // Enable UART
U1STAbits.UTXEN = 1; // Enable UART Tx
//set ring pointers to empty (zero receive/transmit)
rxiptr=rxoptr=txiptr=txoptr=0;
}
void ser_putch(unsigned char byte)
{
// wait until buffer has an empty slot.
//while (((txiptr+1) & SER_FIFO_MASK)==txoptr)
while (U1STAbits.UTXBF)
continue;
txfifo[txiptr] = byte; //place character in buffer
//increase ring input pointer and set it to zer0 if
//it has rolled-it over.
txiptr=(txiptr+1) & SER_FIFO_MASK;
IEC0bits.U1TXIE = 1; //enable interrupt driven
//serial transmission
}
void ser_puts(unsigned char * s)
{
while(*s) //while pointer s is not at end of string
ser_putch(*s++); // send the current character,
// then increment pointer
}
void ser_puthex(unsigned char v)
{
unsigned char c; //define temp variable
c = v >> 4; //get the high nibble and place it in c
if (c>9) { //if more than 9
ser_putch('A'-10+c); // send the difference from 10 + 'A'
} else { //else
ser_putch('0'+c); // send '0' + the high nibble
}
c = v & 0x0F; //get the lower nibble
if (c>9) { //process the character
ser_putch('A'-10+c); //and send it same as above
} else { //
ser_putch('0'+c); //
}
}
unsigned char ser_isrx(void)
{
if(U1STAbits.OERR) //error in reception?
{
U1STAbits.OERR = 0; //must clear the overrun error to keep uart receiving
return 0; // return no characters in buffer
}
return (rxiptr!=rxoptr); //checks buffer if char is present
}
unsigned char ser_getch(void)
{
unsigned char c; //define
while (ser_isrx()==0) //wait until a character is present
continue; //
c=rxfifo[rxoptr]; //get oldest character received
++rxoptr; //move the pointer to discard buffer
rxoptr &= SER_FIFO_MASK; //if the pointer is at end, roll-it over.
return c; //return it
}
void __attribute__((interrupt, no_auto_psv)) _U1TXInterrupt(void)
{
U1TXREG = txfifo[txoptr];
++txoptr;
txoptr &= SER_FIFO_MASK;
if (txoptr==txiptr) IEC0bits.U1TXIE = 0;
}
void __attribute__((interrupt, no_auto_psv)) _U1RXInterrupt(void)
{
rxfifo[rxiptr]=U1RXREG;
ser_tmp=(rxiptr+1) & SER_FIFO_MASK;
if (ser_tmp!=rxoptr) rxiptr=ser_tmp;
IFS0bits.U1RXIF = 0;
}
|
116str-blueosci
|
RemoteDevice/dsPIC Bluetooth Oscilloscope/ser.c
|
C
|
asf20
| 3,132
|
#include "p33fxxxx.h"
#include "timer.h"
volatile unsigned int sampling_period;
const unsigned int PERIODS[]={
PERIOD_5us,
PERIOD_10us,
PERIOD_20us,
PERIOD_50us,
PERIOD_100us,
PERIOD_200us,
PERIOD_500us,
PERIOD_1ms,
PERIOD_2ms,
PERIOD_5ms,
PERIOD_10ms,
PERIOD_20ms,
PERIOD_50ms
};
void timer1_init(void)
{
T1CONbits.TON = 0; // Stops 16-bit Timer1
T1CONbits.TCKPS = 0b00; // Timer1 Input Clock Prescale Select bits
T1CONbits.TCS = 0; // Internal clock (FCY)
T1CONbits.TGATE = 0; // Gated time accumulation disabled
set_sampling_period(PERIOD_200us);
//T1CONbits.TON = 1; // Starts 16-bit Timer1
}
void set_sampling_period(unsigned int period)
{
#if 0
PR1 = period;
#else // adc speed limitation
if( (period==PERIOD_5us) || (period==PERIOD_10us) )
PR1 = PERIOD_20us;
else
PR1 = period;
#endif
sampling_period = period;
}
|
116str-blueosci
|
RemoteDevice/dsPIC Bluetooth Oscilloscope/timer.c
|
C
|
asf20
| 903
|
#include "p33fxxxx.h"
#include "ser.h"
#include "adc.h"
#include "timer.h"
#define MAX_LEVEL 240
#define DATA_START (MAX_LEVEL + 1)
#define DATA_END (MAX_LEVEL + 2)
#define REQ_DATA 0x00
#define ADJ_HORIZONTAL 0x01
#define ADJ_VERTICAL 0x02
#define ADJ_POSITION 0x03
#define CHANNEL1 0x01
#define CHANNEL2 0x02
#define OFFSET1 510 //511
#define OFFSET2 495 //511
#define led_on() PORTCbits.RC3 = 1
#define led_off() PORTCbits.RC3 = 0
void osc_init(void);
void port_init(void);
void store_data(void);
void send_data(void);
unsigned char clamp_value(long value);
long ch1_gain, ch2_gain;
long ch1_position, ch2_position;
|
116str-blueosci
|
RemoteDevice/dsPIC Bluetooth Oscilloscope/main.h
|
C
|
asf20
| 674
|
#ifndef _SER_H_
#define _SER_H_
#define FCY 40000000 // = Fclk/2
#define BAUDRATE 115200 // bps
#define BRGVAL ((FCY/BAUDRATE)/4)-1 // for high-speed mode
/* Valid buffer size value are only power of 2 (ex: 2,4,..,64,128) */
#define SER_BUFFER_SIZE 64
#define SER_FIFO_MASK (SER_BUFFER_SIZE-1)
extern void ser_init(void);
extern void ser_putch(unsigned char byte);
extern void ser_puts(unsigned char * s);
extern void ser_puthex(unsigned char v);
extern unsigned char ser_isrx(void);
extern unsigned char ser_getch(void);
extern void __attribute__((interrupt, no_auto_psv)) _U1TXInterrupt(void);
extern void __attribute__((interrupt, no_auto_psv)) _U1RXInterrupt(void);
extern unsigned char txfifo[SER_BUFFER_SIZE];
extern volatile unsigned char txiptr, txoptr;
extern unsigned char rxfifo[SER_BUFFER_SIZE];
extern volatile unsigned char rxiptr, rxoptr;
extern unsigned char ser_tmp;
#endif // end _SER_H_
|
116str-blueosci
|
RemoteDevice/dsPIC Bluetooth Oscilloscope/ser.h
|
C
|
asf20
| 952
|