
目录
引出
CATIA进阶操作------创成式曲面设计入门(1)线架设计,三维点、直线、平面、曲线
三维空间点生成




三维直线



三维平面


三维曲线








总结
CATIA进阶操作------创成式曲面设计入门(1)线架设计,三维点、直线、平面、曲线
其他内容
异形弹簧
新建几何体

草图编辑,画一条样条线

进行扫掠,圆心和半径

画出曲面上的螺旋线
定义直线,选择曲线的角度/法线

在曲线上创建点

支持面选择扫掠面,角度7度,终点设置大一点,选中支持面上的几何图形

再次选择扫掠,圆心和半径

双击修改,调整一下样条曲线

其他
自定义信号和槽
1.自定义信号
写到signals下
返回void
需要声明,不需要实现
可以有参数,可以重戟

2.自定义槽
返回void
需要声明,也需要实现
可以有参数,可以重载
写到public slot下或者public或者全局函数

3.建立连接

java
// 老师饿了,学生请吃饭
connect(te,&Teacher::hungry,st,&Student::treat);
4.进行触发

自定义信号重载
当自定义信号和槽出现重载
8.1 需要利用还数指针明确指向函数的地址·
8.2void(Teacher::tsignal )QString )=&Teacher::hungry;
8.3 QString转成char *
8.3.1.ToUtf80转为QByteArray
8.3.2.Data0转为Char *
8.4信号可以连接信号
8.5断开信号disconnect
带参数的
java
void (Teacher::*teacherSignal)(QString) = &Teacher::hungry;
void (Student::*StudentSlot)(QString) = &Student::treat;


java
void Student::treat(QString foodName){
// QString -> char * 先转成QByteArray(.toUtf8()) 再转成Char* ()
qDebug() << "请老师吃。。。" << foodName.toUtf8().data();
}
按钮触发

java
// 用一个按钮调用下课
QPushButton *btn = new QPushButton("下课了",this);
// 重置窗口daxiao
this->resize(600,400);
connect(btn,&QPushButton::clicked,this,&Widget::classIsOver);
信号触发信号

java
// 无参的信号和槽连接
void (Teacher::*teacherSignal2)(void) = &Teacher::hungry;
void (Student::*StudentSlot2)(void) = &Student::treat;
connect(te,teacherSignal2,st,StudentSlot2);
// 信号连接信号
connect(btn,&QPushButton::clicked,te,teacherSignal2);
断开信号disconnect
拓展
1、信号是可以连接信号
2、一个信号可以连接多个槽函数
3、多个信号可以连接同一个糟函数
4、信号和槽函数的参数必须类型一一对应
5、信号和槽的参数个数是不是要一致?信号的参数个数可以多余槽函数的参数个数

connect(信号的发送者,发送的信号signal信号),信号接受者,槽函数SLOT)
优点:参数直观
缺点:编译器不会检测爸数类型:
lambda表达式




java
[=](){
btn->setText("aaa");
}();
返回值

java
int ret = []()->int{return 1000;}();
qDebug() << "ret = " << ret;
mutable修饰

java
QPushButton *myBtn1 = new QPushButton(this);
QPushButton *myBtn2 = new QPushButton(this);
myBtn1->move(100,100);
int m = 10;
connect(myBtn1,&QPushButton::clicked,this,
[m]()mutable {m=100+10;qDebug()<< m;});
connect(myBtn2,&QPushButton::clicked,this,
[=](){qDebug()<<m;});
qDebug() << m;
案例

java
QPushButton * btnClose = new QPushButton;
btnClose->setText("close");
btnClose->move(100,0);
btnClose->setParent(this);
connect(btnClose,&QPushButton::clicked,this,
[=](){
btnClose->setText("关闭");
emit te->hungry("娃哈哈");
// this->close();
});