




已阅读5页,还剩3页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
51 2java3java1 fillpolygon.java2 clipsc2.java2.ppt3.ppt-,1p1p21p1p2p1p22p1p23 2sutherlandCcohen1) 2) , 11n2x31234?n-1n 42p31boundary-color ppi= (xi, yi),0in xi, yipn+1=p0 ()2interior_point pinterior_point=truepolygon_color pbackground_color41x, y 2x, y3x, yy xleft xright4xleft, xright 2javapackage last;/applet/sutherlandCcohenimport java.awt.*;import java.applet.applet;public class clipsc2 extends appletint xl=100,xr=200,yb=100,yt=200; public void paint(graphics g) setbackground(color.gray); graphics2d g2=(graphics2d)g; g2.setpaint(color.green); / g2.drawline(int)xl,(int)yb,(int)xl,(int)yt); g2.drawline(int)xl,(int)yb,(int)xr,(int)yb); g2.drawline(int)xl,(int)yt,(int)xr,(int)yt); g2.drawline(int)xr,(int)yb,(int)xr,(int)yt); g2.setpaint(color.blue); / /g2.drawline(50,50,280,280); g2.drawline(50,150,250,150); g2.setpaint(color.red); / /sutherland_cohen(g2,50,50,280,280); sutherland_cohen(g2,50,150,250,150); / / 0000, public int code(float x,float y) int c=0; if(x<xl)c=c|1; else if(x>xr)c=c|2; if(y<yb)c=c|4; else if(y>yt)c=c|8; return c; / 0 1 10 100 1000 /0000/sutherland_cohenpublic void sutherland_cohen(graphics g,float x0,float y0,float x2,float y2) int c1,c2,c; float x,y,wx,wy; boolean accept=false,done=false; c1=code(x0,y0); c2=code(x2,y2); if (c1|c2)=0)/0 accept=true; done=true; else if(c1&c2)!=0)done=true;/1 else c=c1; if(c=0)c=c2; wx=x2-x0; if (c&8)=8) / x=x0+wx*(yt-y0)/wy; y=yt; else if (c&4)=4) x=x0+wx*(yb-y0)/wy; y=yb; do wy=y2-y0; y=y0+wy*(xl-x0)/wx; x=xl; else/(c&2)=2 y=y0+wy*(xr-x0)/wx; x=xr; if (c=c1) /c1!=0, x0=x; y0=y; c1=code(x0,y0); else / x2=x; y2=y; c2=code(x2,y2); /else while (done=false); if(accept)g.drawline(int)x0,(int)y0,(int)x2,(int)y2); package last;/fillpolygon.java/import java.util.*;import java.awt.*; /java /awt/java/ import java.awt.image.*; import java.awt.event.*;import java.applet.applet; /appletimport pakage1_4.mycanvas;/mycanvas /*activeedgelistentryclass activeedgelistentry /*activeedgelistclass activeedgelist activeedgelistentry header=null; / activeedgelistentry tailer=null; / / public activeedgelist(activeedgelistentry element) / public void insert(activeedgelistentry element) activeedgelistentry sentinel; / / / if(element=null | this.header=null) header=tailer=element; / int name; / int topx; int topy; int botx; int boty; /yx /yy /yx /yy /-(botx-topx)/(boty-topy) double delta; double x; /x boolean ishorizontal; / activeedgelistentry next; / / throw new nullpointerexception(); sentinel=this.header; / int xt=element.topx; /topx int xtold=sentinel.topx; double olddelta=sentinel.delta; double newdelta=element.delta; /* topxdelta */ /* */ /delta5 j2me2013/2014 1 252200801 j2me j2me j2me12? (hirecord)? (hirecord)? (hirecord)3()4eclipse3.35()6j2me5_ () 123ubuntu linux10.04 geditgcc10051205#include<stdio.h>#include<malloc.h>typedef struct memory_blockint name; / int address; / int length; / int flag; /, struct memory_block *next; /memory_block;#define num 5#define len sizeof(memory_block)void allocation(memory_block *header,int name,int length_p)memory_block *temp,*t,*tt; int minsize=2; /while(t!=0) if(t->length>length_p&&t->flag=0) break; t=t->next;/ if(t->length-length_p>minsize)temp=(memory_block*)malloc(len); temp->name=-1; temp->flag=0; temp->length=t->length-length_p; temp->address=t->address+length_p; t->name=name; t->flag=1; t->length=length_p; temp->next=t->next; t->next=temp;/ elset->name=name;t->flag=1;void reclaim(int processname, memory_block *header) memory_block *temp,*t,*tt;temp=t; while(t->name!=processname) temp=t; t=t->next; /t / if(t->next!=null) if(temp->flag=0&&t->next->flag=0) temp->name=-1; temp->length=temp->length+t->length+t->next->length; tt=t->next; temp->next=tt->next; / else if(temp->flag=0) temp->name=-1; temp->length=temp->length+t->length; temp->next=t->next; / else if(t->next->flag=0) t->name=-1; t->length=t->length+t->next->length; t->flag=0; tt=t->next; t->next=tt->next;/ elset->flag=0; /t/ else if(temp->flag=0)temp->name=-1; temp->length=temp->length+t->length;temp=t->next;else /t->name=-1;void main() / t->flag=0;int length_p,i,processname;memory_block *header,*t;header=(memory_block*)malloc(len); / header->name=-1;header->address=0;header->length=100;header->flag=0;header->next=null;5 102 e10700217 2012328. .adobe premierepremiere proaudio effectpremiere propremiere pro. premiere pro .audio effect1. stereo2. balance 3. bandpass() 4. bass)5. channel volume() 6. denoiser 7. delay 8. dynamics 9. eq10. fill left() 11. fill right() 12. highpass 13. invert 14. lowpass20. swap channel 21. treble) 22. volume 18230.adobe premierepremiere proaudio effectpremiere propremiere pro.audio effect23. stereo24. balance 25. bandpass() 26. bass)27. channel volume() 28. denoiser 29. delay 30. dynamics 31. eq32. fill left() 33. fill right() 34. highpass 35. invert 36. lowpass42. swap channel 43. treble) 44. volume. premiere pro . premiere pro . 1bas
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 内蒙古通辽市库伦旗2026届九上化学期中学业水平测试试题含解析
- 江苏省句容市二中学片区合作共同体2026届英语九上期末质量检测模拟试题含解析
- 幼儿园期末汇报通关
- 安徽省宿州十三校2026届英语九年级第一学期期末统考试题含解析
- 福建省泉州台商投资区五校联考2026届九年级化学第一学期期中质量检测试题含解析
- 2026届辽宁省台安县化学九年级第一学期期中监测试题含解析
- 2026届广东省惠阳市马安中学英语九上期末学业质量监测模拟试题含解析
- 2026届浙江省杭州市余杭区英语九上期末经典试题含解析
- 巢湖市重点中学2026届九上化学期中质量检测试题含解析
- 2025年辅警勤务岗面试题及答案
- 第8课《网络新世界》第一课时-统编版《道德与法治》四年级上册教学课件
- 2025年审计部招聘考试模拟题及答案详解
- 2025年招聘市场年中洞察报告-瀚纳仕
- Bowtie安全分析培训课件
- 退役军人优抚政策课件
- 财务遴选笔试题及答案
- (2025秋新版)人教版二年级数学上册全册教案(教学设计)
- 六年级上册音乐课教案
- 肿瘤病人疼痛评估与干预策略
- 物业管理人员考核制度及标准
- 计算机视觉技术课件
评论
0/150
提交评论