-
Notifications
You must be signed in to change notification settings - Fork 0
/
crossSection.h
60 lines (50 loc) · 1.39 KB
/
crossSection.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef SECTION_H
#define SECTION_H
#include<QString>
class shape{
public:
double xc,yc;
double area;
double Ix,Iy,Ixy;
shape(double x,double y,double A,double ix,double iy,double ixy);
shape();
bool xSymmetry;
bool ySymmetry;
double Ixc();
double Iyc();
double Ixyc();
shape& move(double& x, double& y);
shape& rotate(double theta);
};
class rectangle:public shape{
public:
double h,b;
rectangle(double& x,double& y,double& wid,double& hei);
//void draw();
//...
};
class circle:public shape{
public:
double diameter;
circle(double& x,double& y,double& d);
//void draw();
//...
};
class ring:public shape{
public:
double outerDiameter, innerDiameter;
ring(double& x,double& y,double& d2,double d1);
//void draw();
//...
};
class namedShp:public shape{
public:
QString name;
namedShp(double x,double y,double A,double ix,double iy,double ixy,QString qstr):shape(x,y,A,ix,iy,ixy),name(qstr) {}
};
shape operator+(shape shp1,shape shp2);
shape operator-(shape shp1,shape shp2);
bool Intersect(rectangle& rect, circle& cir);
bool Intersect(circle& cir, rectangle& rect);
bool Intersect(rectangle& rect1, rectangle& rect2);
#endif // SECTION_H