Edit GCS module and ui
This commit is contained in:
23
GCS/Geo.cpp
23
GCS/Geo.cpp
@@ -33,6 +33,13 @@ namespace GCS
|
||||
{
|
||||
|
||||
//----------------Point
|
||||
|
||||
Point::Point(double* px, double* py, int _tag) {
|
||||
x = px;
|
||||
y = py;
|
||||
tag = _tag;
|
||||
}
|
||||
|
||||
int Point::PushOwnParams(VEC_pD& pvec)
|
||||
{
|
||||
int cnt = 0;
|
||||
@@ -130,6 +137,12 @@ DeriVector2 Curve::Value(double /*u*/, double /*du*/, const double* /*derivparam
|
||||
|
||||
//----------------Line
|
||||
|
||||
Line::Line(Point _p1, Point _p2, int _tag) {
|
||||
p1 = _p1;
|
||||
p2 = _p2;
|
||||
tag = _tag;
|
||||
}
|
||||
|
||||
DeriVector2 Line::CalculateNormal(const Point& p, const double* derivparam) const
|
||||
{
|
||||
(void)p;
|
||||
@@ -178,6 +191,16 @@ Line* Line::Copy()
|
||||
return crv;
|
||||
}
|
||||
|
||||
void Line::draw(QPainter& p, bool highlight){
|
||||
QPen pen = highlight ? QPen(Qt::red, 4) : QPen(Qt::black, 2);
|
||||
p.setPen(pen);
|
||||
p.drawLine(QPointF(p1.get_X(), p1.get_Y()), QPointF(p2.get_X(), p2.get_Y()));
|
||||
|
||||
p.setBrush(highlight ? Qt::red : Qt::blue);
|
||||
p.drawEllipse(QPointF(p1.get_X(), p1.get_Y()), 4, 4);
|
||||
p.drawEllipse(QPointF(p2.get_X(), p2.get_Y()), 4, 4);
|
||||
}
|
||||
|
||||
|
||||
//---------------circle
|
||||
|
||||
|
||||
Reference in New Issue
Block a user