阅读以下说明和C++代码,将应填入 (n) 处的字句写在对应栏内。
[说明]
某绘图系统存在Point、Line、Square三种图元,它们具有Shape接口,图元的类图关系如图18-1所示。现要将Circle图元加入此绘图系统以实现功能扩充。已知某第三方库已经提供了XCircle类,且完全满足系统新增的Circle图元所需的功能,但XCircle不是由Shape派生而来的,它提供的接口不能被系统直接使用。代码18.1既使用了XCircle又遵循了Shape规定的接口,既避免了从头开发一个新的Circle类,又可以不修改绘图系统中已经定义的接口。代码18.2根据用户指定的参数生成特定的图元实例,并对之进行显示操作。
绘图系统定义的接口与XCircle提供的显示接口及其功能如表18-1所示。
[代码18.1]
class Circle:public (1)
private:
(2) m_circle;
public:
void display( )
m_circle. (3) ;
;
[代码18.2]
class Factory
public:
(4) getShape Instance(int type) //生成特定类实例
switch(type)
case 0:return new point;
case 1:return new Rectangle;
case 2:return new line;
case 3:return new Circle;
default:return NULL;
;
void main(int argc,char *argv[])
if(argc!=2)
cout<<"error parameters!"<<end1;
return;
int type=atoi(argv[1]);
Factory factory;
Shape *s;
S=factory. (5) ;
if(s=NULL)
cout<<"Error get the instance!"<<end1;
return;
C->display( );
(6) ;
return;
(1)处填()。
阅读以下说明和C++代码,将应填入 (n) 处的字句写在对应栏内。
[说明]
某绘图系统存在Point、Line、Square三种图元,它们具有Shape接口,图元的类图关系如图18-1所示。现要将Circle图元加入此绘图系统以实现功能扩充。已知某第三方库已经提供了XCircle类,且完全满足系统新增的Circle图元所需的功能,但XCircle不是由Shape派生而来的,它提供的接口不能被系统直接使用。代码18.1既使用了XCircle又遵循了Shape规定的接口,既避免了从头开发一个新的Circle类,又可以不修改绘图系统中已经定义的接口。代码18.2根据用户指定的参数生成特定的图元实例,并对之进行显示操作。
绘图系统定义的接口与XCircle提供的显示接口及其功能如表18-1所示。
[代码18.1]
class Circle:public (1)
private:
(2) m_circle;
public:
void display( )
m_circle. (3) ;
;
[代码18.2]
class Factory
public:
(4) getShape Instance(int type) //生成特定类实例
switch(type)
case 0:return new point;
case 1:return new Rectangle;
case 2:return new line;
case 3:return new Circle;
default:return NULL;
;
void main(int argc,char *argv[])
if(argc!=2)
cout<<"error parameters!"<<end1;
return;
int type=atoi(argv[1]);
Factory factory;
Shape *s;
S=factory. (5) ;
if(s=NULL)
cout<<"Error get the instance!"<<end1;
return;
C->display( );
(6) ;
return;
(2)处填()。
阅读以下说明和C++代码,将应填入 (n) 处的字句写在对应栏内。
[说明]
某绘图系统存在Point、Line、Square三种图元,它们具有Shape接口,图元的类图关系如图18-1所示。现要将Circle图元加入此绘图系统以实现功能扩充。已知某第三方库已经提供了XCircle类,且完全满足系统新增的Circle图元所需的功能,但XCircle不是由Shape派生而来的,它提供的接口不能被系统直接使用。代码18.1既使用了XCircle又遵循了Shape规定的接口,既避免了从头开发一个新的Circle类,又可以不修改绘图系统中已经定义的接口。代码18.2根据用户指定的参数生成特定的图元实例,并对之进行显示操作。
绘图系统定义的接口与XCircle提供的显示接口及其功能如表18-1所示。
[代码18.1]
class Circle:public (1)
private:
(2) m_circle;
public:
void display( )
m_circle. (3) ;
;
[代码18.2]
class Factory
public:
(4) getShape Instance(int type) //生成特定类实例
switch(type)
case 0:return new point;
case 1:return new Rectangle;
case 2:return new line;
case 3:return new Circle;
default:return NULL;
;
void main(int argc,char *argv[])
if(argc!=2)
cout<<"error parameters!"<<end1;
return;
int type=atoi(argv[1]);
Factory factory;
Shape *s;
S=factory. (5) ;
if(s=NULL)
cout<<"Error get the instance!"<<end1;
return;
C->display( );
(6) ;
return;
(4)处填()。
阅读以下说明和C++代码,将应填入 (n) 处的字句写在对应栏内。
[说明]
某绘图系统存在Point、Line、Square三种图元,它们具有Shape接口,图元的类图关系如图18-1所示。现要将Circle图元加入此绘图系统以实现功能扩充。已知某第三方库已经提供了XCircle类,且完全满足系统新增的Circle图元所需的功能,但XCircle不是由Shape派生而来的,它提供的接口不能被系统直接使用。代码18.1既使用了XCircle又遵循了Shape规定的接口,既避免了从头开发一个新的Circle类,又可以不修改绘图系统中已经定义的接口。代码18.2根据用户指定的参数生成特定的图元实例,并对之进行显示操作。
绘图系统定义的接口与XCircle提供的显示接口及其功能如表18-1所示。
[代码18.1]
class Circle:public (1)
private:
(2) m_circle;
public:
void display( )
m_circle. (3) ;
;
[代码18.2]
class Factory
public:
(4) getShape Instance(int type) //生成特定类实例
switch(type)
case 0:return new point;
case 1:return new Rectangle;
case 2:return new line;
case 3:return new Circle;
default:return NULL;
;
void main(int argc,char *argv[])
if(argc!=2)
cout<<"error parameters!"<<end1;
return;
int type=atoi(argv[1]);
Factory factory;
Shape *s;
S=factory. (5) ;
if(s=NULL)
cout<<"Error get the instance!"<<end1;
return;
C->display( );
(6) ;
return;
(5)处填()。
getShapeInstance(type)
阅读以下说明和C++代码,将应填入 (n) 处的字句写在对应栏内。
[说明]
某绘图系统存在Point、Line、Square三种图元,它们具有Shape接口,图元的类图关系如图18-1所示。现要将Circle图元加入此绘图系统以实现功能扩充。已知某第三方库已经提供了XCircle类,且完全满足系统新增的Circle图元所需的功能,但XCircle不是由Shape派生而来的,它提供的接口不能被系统直接使用。代码18.1既使用了XCircle又遵循了Shape规定的接口,既避免了从头开发一个新的Circle类,又可以不修改绘图系统中已经定义的接口。代码18.2根据用户指定的参数生成特定的图元实例,并对之进行显示操作。
绘图系统定义的接口与XCircle提供的显示接口及其功能如表18-1所示。
[代码18.1]
class Circle:public (1)
private:
(2) m_circle;
public:
void display( )
m_circle. (3) ;
;
[代码18.2]
class Factory
public:
(4) getShape Instance(int type) //生成特定类实例
switch(type)
case 0:return new point;
case 1:return new Rectangle;
case 2:return new line;
case 3:return new Circle;
default:return NULL;
;
void main(int argc,char *argv[])
if(argc!=2)
cout<<"error parameters!"<<end1;
return;
int type=atoi(argv[1]);
Factory factory;
Shape *s;
S=factory. (5) ;
if(s=NULL)
cout<<"Error get the instance!"<<end1;
return;
C->display( );
(6) ;
return;
(3)处填()。
阅读以下说明和C++代码,将应填入 (n) 处的字句写在对应栏内。
[说明]
某绘图系统存在Point、Line、Square三种图元,它们具有Shape接口,图元的类图关系如图18-1所示。现要将Circle图元加入此绘图系统以实现功能扩充。已知某第三方库已经提供了XCircle类,且完全满足系统新增的Circle图元所需的功能,但XCircle不是由Shape派生而来的,它提供的接口不能被系统直接使用。代码18.1既使用了XCircle又遵循了Shape规定的接口,既避免了从头开发一个新的Circle类,又可以不修改绘图系统中已经定义的接口。代码18.2根据用户指定的参数生成特定的图元实例,并对之进行显示操作。
绘图系统定义的接口与XCircle提供的显示接口及其功能如表18-1所示。
[代码18.1]
class Circle:public (1)
private:
(2) m_circle;
public:
void display( )
m_circle. (3) ;
;
[代码18.2]
class Factory
public:
(4) getShape Instance(int type) //生成特定类实例
switch(type)
case 0:return new point;
case 1:return new Rectangle;
case 2:return new line;
case 3:return new Circle;
default:return NULL;
;
void main(int argc,char *argv[])
if(argc!=2)
cout<<"error parameters!"<<end1;
return;
int type=atoi(argv[1]);
Factory factory;
Shape *s;
S=factory. (5) ;
if(s=NULL)
cout<<"Error get the instance!"<<end1;
return;
C->display( );
(6) ;
return;
(6)处填()。
getShapeInstance(type)
建立BIM模型的必要步骤是 ( )
A:绘图元 B:建立构建 C:定义属性 D:渲染 E:动画制作
在项目中,尺寸标标注属于哪种类别的图元?( )
A:注释图元 B:模型图元 C:参数图元 D:视图图元
添加或删除组中的图元步骤错误的是 ( )
A:在绘图区域中选择要修改的组。 如果要修改的组是嵌套的 ,请按Shift键,直到高亮显示该组,然后单击选中它 B:在选项栏上单击 “编辑组”。在组编辑器工具栏上添加或删除图元 C:选择要添加到组的图元或者要从组删除的图元 D:选择要添加到组的图元或者要从组删除的图元添加完成后 ,单击“完成”
您可能感兴趣的题目