[TD]CI clang warnings
This commit is contained in:
@@ -51,7 +51,7 @@ QGIArrow::QGIArrow() :
|
||||
m_size(getPrefArrowSize()),
|
||||
m_style(0),
|
||||
m_dirMode(false),
|
||||
m_dir(Base::Vector3d(1.0,0.0,0.0))
|
||||
m_dir(Base::Vector3d(1.0, 0.0, 0.0))
|
||||
{
|
||||
setFlipped(false);
|
||||
setFillStyle(Qt::SolidPattern);
|
||||
@@ -69,40 +69,40 @@ void QGIArrow::draw() {
|
||||
QPainterPath path;
|
||||
if (m_style == ArrowType::FILLED_ARROW) {
|
||||
if (m_dirMode) {
|
||||
path = makeFilledTriangle(getDirection(), m_size,m_size/6.0);
|
||||
path = makeFilledTriangle(getDirection(), m_size, m_size/6.0);
|
||||
} else {
|
||||
path = makeFilledTriangle(m_size,m_size/6.0,isFlipped()); //"arrow l/w sb 3/1" ??
|
||||
path = makeFilledTriangle(m_size, m_size/6.0, isFlipped()); //"arrow l/w sb 3/1" ??
|
||||
}
|
||||
} else if (m_style == ArrowType::OPEN_ARROW) {
|
||||
if (m_dirMode) {
|
||||
path = makeOpenArrow(getDirection(), m_size,m_size/3.0); //broad arrow?
|
||||
path = makeOpenArrow(getDirection(), m_size, m_size/3.0); //broad arrow?
|
||||
} else {
|
||||
path = makeOpenArrow(m_size,m_size/3.0,isFlipped());
|
||||
path = makeOpenArrow(m_size, m_size/3.0, isFlipped());
|
||||
}
|
||||
} else if (m_style == ArrowType::TICK) {
|
||||
if (m_dirMode) {
|
||||
path = makeHashMark(getDirection(), m_size/2.0,m_size/2.0); //big enough?
|
||||
path = makeHashMark(getDirection(), m_size/2.0, m_size/2.0); //big enough?
|
||||
} else {
|
||||
path = makeHashMark(m_size/2.0,m_size/2.0,isFlipped()); //big enough?
|
||||
path = makeHashMark(m_size/2.0, m_size/2.0, isFlipped()); //big enough?
|
||||
}
|
||||
} else if (m_style == ArrowType::DOT) {
|
||||
path = makeDot(m_size/2.0,m_size/2.0,isFlipped());
|
||||
path = makeDot(m_size/2.0, m_size/2.0, isFlipped());
|
||||
} else if (m_style == ArrowType::OPEN_CIRCLE) {
|
||||
path = makeOpenDot(m_size/2.0,m_size/2.0,isFlipped());
|
||||
path = makeOpenDot(m_size/2.0, m_size/2.0, isFlipped());
|
||||
} else if (m_style == ArrowType::FORK) {
|
||||
if (m_dirMode) {
|
||||
path = makeForkArrow(getDirection(), m_size/2.0,m_size/2.0); //big enough?
|
||||
path = makeForkArrow(getDirection(), m_size/2.0, m_size/2.0); //big enough?
|
||||
} else {
|
||||
path = makeForkArrow(m_size/2.0,m_size/2.0,isFlipped()); //big enough?
|
||||
path = makeForkArrow(m_size/2.0, m_size/2.0, isFlipped()); //big enough?
|
||||
}
|
||||
} else if (m_style == ArrowType::FILLED_TRIANGLE){
|
||||
if (m_dirMode) {
|
||||
path = makePyramid(getDirection(), m_size);
|
||||
} else {
|
||||
path = makePyramid(m_size,isFlipped());
|
||||
path = makePyramid(m_size, isFlipped());
|
||||
}
|
||||
}else {
|
||||
path = makeFilledTriangle(m_size,m_size/6.0,isFlipped()); //sb a question mark or ???
|
||||
path = makeFilledTriangle(m_size, m_size/6.0, isFlipped()); //sb a question mark or ???
|
||||
}
|
||||
setPath(path);
|
||||
}
|
||||
@@ -115,15 +115,15 @@ void QGIArrow::setSize(double s)
|
||||
|
||||
QPainterPath QGIArrow::makeFilledTriangle(double length, double width, bool flipped)
|
||||
{
|
||||
//(0,0) is tip of arrow
|
||||
//(0, 0) is tip of arrow
|
||||
if (!flipped) {
|
||||
length *= -1;
|
||||
}
|
||||
|
||||
QPainterPath path;
|
||||
path.moveTo(QPointF(0.,0.));
|
||||
path.lineTo(QPointF(Rez::guiX(length),Rez::guiX(-width)));
|
||||
path.lineTo(QPointF(Rez::guiX(length),Rez::guiX(width)));
|
||||
path.moveTo(QPointF(0., 0.));
|
||||
path.lineTo(QPointF(Rez::guiX(length), Rez::guiX(-width)));
|
||||
path.lineTo(QPointF(Rez::guiX(length), Rez::guiX(width)));
|
||||
path.closeSubpath();
|
||||
setFillStyle(Qt::SolidPattern);
|
||||
return path;
|
||||
@@ -131,18 +131,18 @@ QPainterPath QGIArrow::makeFilledTriangle(double length, double width, bool flip
|
||||
|
||||
QPainterPath QGIArrow::makeFilledTriangle(Base::Vector3d dir, double length, double width)
|
||||
{
|
||||
//(0,0) is tip of arrow
|
||||
//(0, 0) is tip of arrow
|
||||
// dir is direction arrow points
|
||||
Base::Vector3d negDir = -dir;
|
||||
negDir.Normalize();
|
||||
Base::Vector3d perp(-negDir.y,negDir.x, 0.0);
|
||||
Base::Vector3d perp(-negDir.y, negDir.x, 0.0);
|
||||
Base::Vector3d barb1 = negDir * length + perp * width;
|
||||
Base::Vector3d barb2 = negDir * length - perp * width;
|
||||
|
||||
|
||||
QPainterPath path;
|
||||
path.moveTo(QPointF(0.,0.));
|
||||
path.lineTo(QPointF(Rez::guiX(barb1.x),Rez::guiX(barb1.y)));
|
||||
path.lineTo(QPointF(Rez::guiX(barb2.x),Rez::guiX(barb2.y)));
|
||||
path.moveTo(QPointF(0., 0.));
|
||||
path.lineTo(QPointF(Rez::guiX(barb1.x), Rez::guiX(barb1.y)));
|
||||
path.lineTo(QPointF(Rez::guiX(barb2.x), Rez::guiX(barb2.y)));
|
||||
path.closeSubpath();
|
||||
setFillStyle(Qt::SolidPattern);
|
||||
return path;
|
||||
@@ -150,32 +150,32 @@ QPainterPath QGIArrow::makeFilledTriangle(Base::Vector3d dir, double length, dou
|
||||
|
||||
QPainterPath QGIArrow::makeOpenArrow(double length, double width, bool flipped)
|
||||
{
|
||||
//(0,0) is tip of arrow
|
||||
//(0, 0) is tip of arrow
|
||||
if (!flipped) {
|
||||
length *= -1;
|
||||
}
|
||||
|
||||
QPainterPath path;
|
||||
path.moveTo(QPointF(Rez::guiX(length),Rez::guiX(-width)));
|
||||
path.lineTo(QPointF(0.,0.));
|
||||
path.lineTo(QPointF(Rez::guiX(length),Rez::guiX(width)));
|
||||
path.moveTo(QPointF(Rez::guiX(length), Rez::guiX(-width)));
|
||||
path.lineTo(QPointF(0., 0.));
|
||||
path.lineTo(QPointF(Rez::guiX(length), Rez::guiX(width)));
|
||||
setFillStyle(Qt::NoBrush);
|
||||
return path;
|
||||
}
|
||||
|
||||
QPainterPath QGIArrow::makeOpenArrow(Base::Vector3d dir, double length, double width)
|
||||
{
|
||||
//(0,0) is tip of arrow
|
||||
//(0, 0) is tip of arrow
|
||||
Base::Vector3d negDir = -dir;
|
||||
negDir.Normalize();
|
||||
Base::Vector3d perp(-negDir.y,negDir.x, 0.0);
|
||||
Base::Vector3d perp(-negDir.y, negDir.x, 0.0);
|
||||
Base::Vector3d barb1 = negDir * length + perp * width;
|
||||
Base::Vector3d barb2 = negDir * length - perp * width;
|
||||
|
||||
|
||||
QPainterPath path;
|
||||
path.moveTo(QPointF(Rez::guiX(barb1.x),Rez::guiX(barb1.y)));
|
||||
path.lineTo(QPointF(0.,0.));
|
||||
path.lineTo(QPointF(Rez::guiX(barb2.x),Rez::guiX(barb2.y)));
|
||||
path.moveTo(QPointF(Rez::guiX(barb1.x), Rez::guiX(barb1.y)));
|
||||
path.lineTo(QPointF(0., 0.));
|
||||
path.lineTo(QPointF(Rez::guiX(barb2.x), Rez::guiX(barb2.y)));
|
||||
setFillStyle(Qt::NoBrush);
|
||||
return path;
|
||||
}
|
||||
@@ -184,14 +184,14 @@ QPainterPath QGIArrow::makeOpenArrow(Base::Vector3d dir, double length, double w
|
||||
QPainterPath QGIArrow::makeHashMark(double length, double width, bool flipped) //Arch tick
|
||||
{
|
||||
double adjWidth = 1.0;
|
||||
//(0,0) is tip of arrow
|
||||
//(0, 0) is tip of arrow
|
||||
if (!flipped) {
|
||||
length *= -1;
|
||||
adjWidth *= -1;
|
||||
}
|
||||
QPainterPath path;
|
||||
path.moveTo(QPointF(Rez::guiX(length),Rez::guiX(adjWidth * (-width))));
|
||||
path.lineTo(QPointF(Rez::guiX(-length),Rez::guiX(adjWidth * width)));
|
||||
path.moveTo(QPointF(Rez::guiX(length), Rez::guiX(adjWidth * (-width))));
|
||||
path.lineTo(QPointF(Rez::guiX(-length), Rez::guiX(adjWidth * width)));
|
||||
setFillStyle(Qt::NoBrush);
|
||||
return path;
|
||||
}
|
||||
@@ -203,13 +203,13 @@ QPainterPath QGIArrow::makeHashMark(Base::Vector3d dir, double length, double wi
|
||||
Base::Vector3d normDir = dir;
|
||||
negDir.Normalize();
|
||||
normDir.Normalize();
|
||||
Base::Vector3d perp(-negDir.y,negDir.x, 0.0);
|
||||
Base::Vector3d perp(-negDir.y, negDir.x, 0.0);
|
||||
Base::Vector3d barb1 = negDir * length - perp * (adjWidth * width);
|
||||
Base::Vector3d barb2 = normDir * length + perp * (adjWidth * width);
|
||||
|
||||
|
||||
QPainterPath path;
|
||||
path.moveTo(QPointF(Rez::guiX(barb1.x),Rez::guiX(barb1.y)));
|
||||
path.lineTo(QPointF(Rez::guiX(barb2.x),Rez::guiX(barb2.y)));
|
||||
path.moveTo(QPointF(Rez::guiX(barb1.x), Rez::guiX(barb1.y)));
|
||||
path.lineTo(QPointF(Rez::guiX(barb2.x), Rez::guiX(barb2.y)));
|
||||
setFillStyle(Qt::NoBrush);
|
||||
return path;
|
||||
}
|
||||
@@ -218,7 +218,7 @@ QPainterPath QGIArrow::makeDot(double length, double width, bool flipped) //cl
|
||||
{
|
||||
Q_UNUSED(flipped);
|
||||
QPainterPath path;
|
||||
path.moveTo(0.0,0.0); ////(0,0) is Center of dot
|
||||
path.moveTo(0.0, 0.0); ////(0, 0) is Center of dot
|
||||
path.addEllipse(Rez::guiX(-length/2.0), Rez::guiX(-width/2.0), Rez::guiX(length), Rez::guiX(width));
|
||||
setFillStyle(Qt::SolidPattern);
|
||||
return path;
|
||||
@@ -228,7 +228,7 @@ QPainterPath QGIArrow::makeOpenDot(double length, double width, bool flipped)
|
||||
{
|
||||
Q_UNUSED(flipped);
|
||||
QPainterPath path;
|
||||
path.moveTo(0.0,0.0); ////(0,0) is Center of dot
|
||||
path.moveTo(0.0, 0.0); ////(0, 0) is Center of dot
|
||||
path.addEllipse(Rez::guiX(-length/2.0), Rez::guiX(-width/2.0), Rez::guiX(length), Rez::guiX(width));
|
||||
setFillStyle(Qt::NoBrush);
|
||||
return path;
|
||||
@@ -236,34 +236,34 @@ QPainterPath QGIArrow::makeOpenDot(double length, double width, bool flipped)
|
||||
|
||||
QPainterPath QGIArrow::makeForkArrow(double length, double width, bool flipped)
|
||||
{
|
||||
//(0,0) is tip of arrow
|
||||
//(0, 0) is tip of arrow
|
||||
if (flipped) {
|
||||
length *= -1;
|
||||
}
|
||||
|
||||
QPainterPath path;
|
||||
path.moveTo(QPointF(Rez::guiX(length),Rez::guiX(-width)));
|
||||
path.lineTo(QPointF(0.,0.));
|
||||
path.lineTo(QPointF(Rez::guiX(length),Rez::guiX(width)));
|
||||
path.moveTo(QPointF(Rez::guiX(length), Rez::guiX(-width)));
|
||||
path.lineTo(QPointF(0., 0.));
|
||||
path.lineTo(QPointF(Rez::guiX(length), Rez::guiX(width)));
|
||||
setFillStyle(Qt::NoBrush);
|
||||
return path;
|
||||
}
|
||||
|
||||
QPainterPath QGIArrow::makeForkArrow(Base::Vector3d dir, double length, double width)
|
||||
{
|
||||
//(0,0) is tip of arrow
|
||||
//(0, 0) is tip of arrow
|
||||
Base::Vector3d negDir = -dir;
|
||||
Base::Vector3d normDir = dir;
|
||||
negDir.Normalize();
|
||||
normDir.Normalize();
|
||||
Base::Vector3d perp(-normDir.y,normDir.x, 0.0);
|
||||
Base::Vector3d perp(-normDir.y, normDir.x, 0.0);
|
||||
Base::Vector3d barb1 = normDir * length + perp * width;
|
||||
Base::Vector3d barb2 = normDir * length - perp * width;
|
||||
|
||||
|
||||
QPainterPath path;
|
||||
path.moveTo(QPointF(Rez::guiX(barb1.x),Rez::guiX(barb1.y)));
|
||||
path.lineTo(QPointF(0.,0.));
|
||||
path.lineTo(QPointF(Rez::guiX(barb2.x),Rez::guiX(barb2.y)));
|
||||
path.moveTo(QPointF(Rez::guiX(barb1.x), Rez::guiX(barb1.y)));
|
||||
path.lineTo(QPointF(0., 0.));
|
||||
path.lineTo(QPointF(Rez::guiX(barb2.x), Rez::guiX(barb2.y)));
|
||||
setFillStyle(Qt::NoBrush);
|
||||
return path;
|
||||
}
|
||||
@@ -273,7 +273,7 @@ QPainterPath QGIArrow::makePyramid(double length, bool flipped)
|
||||
double half_width = length/2.;
|
||||
double top = -length;
|
||||
double base = 0.;
|
||||
// [(0,-width), (0, width)] is base of arrow
|
||||
// [(0, -width), (0, width)] is base of arrow
|
||||
if (flipped) {
|
||||
top = 0.;
|
||||
base = -length;
|
||||
@@ -282,8 +282,8 @@ QPainterPath QGIArrow::makePyramid(double length, bool flipped)
|
||||
base = Rez::guiX(base);
|
||||
QPainterPath path;
|
||||
path.moveTo(QPointF(top, 0.));
|
||||
path.lineTo(QPointF(base,Rez::guiX(-half_width)));
|
||||
path.lineTo(QPointF(base,Rez::guiX(half_width)));
|
||||
path.lineTo(QPointF(base, Rez::guiX(-half_width)));
|
||||
path.lineTo(QPointF(base, Rez::guiX(half_width)));
|
||||
path.closeSubpath();
|
||||
setFillStyle(Qt::SolidPattern);
|
||||
return path;
|
||||
@@ -291,20 +291,20 @@ QPainterPath QGIArrow::makePyramid(double length, bool flipped)
|
||||
|
||||
QPainterPath QGIArrow::makePyramid(Base::Vector3d dir, double length)
|
||||
{
|
||||
//(0,0) is tip of arrow
|
||||
//(0, 0) is tip of arrow
|
||||
// dir is direction arrow points
|
||||
Base::Vector3d negDir = -dir;
|
||||
negDir.Normalize();
|
||||
double width = length / 2.;
|
||||
Base::Vector3d perp(-negDir.y,negDir.x, 0.0);
|
||||
Base::Vector3d perp(-negDir.y, negDir.x, 0.0);
|
||||
Base::Vector3d barb1 = perp * width;
|
||||
Base::Vector3d barb2 = perp * -width;
|
||||
Base::Vector3d top = negDir * length;
|
||||
|
||||
QPainterPath path;
|
||||
path.moveTo(QPointF(Rez::guiX(top.x),Rez::guiX(top.y)));
|
||||
path.lineTo(QPointF(Rez::guiX(barb1.x),Rez::guiX(barb1.y)));
|
||||
path.lineTo(QPointF(Rez::guiX(barb2.x),Rez::guiX(barb2.y)));
|
||||
path.moveTo(QPointF(Rez::guiX(top.x), Rez::guiX(top.y)));
|
||||
path.lineTo(QPointF(Rez::guiX(barb1.x), Rez::guiX(barb1.y)));
|
||||
path.lineTo(QPointF(Rez::guiX(barb2.x), Rez::guiX(barb2.y)));
|
||||
path.closeSubpath();
|
||||
setFillStyle(Qt::SolidPattern);
|
||||
return path;
|
||||
@@ -326,7 +326,7 @@ double QGIArrow::getOverlapAdjust(int style, double size)
|
||||
// ex for fork and tick, adjustment sb zero. 0.25 is good for filled triangle, 0.1 for open arrow.
|
||||
// open circle sb = radius
|
||||
// NOTE: this may need to be adjusted to account for line thickness too.
|
||||
// Base::Console().Message("QGIA::getOverlapAdjust(%d, %.3f) \n",style, size);
|
||||
// Base::Console().Message("QGIA::getOverlapAdjust(%d, %.3f) \n", style, size);
|
||||
double result = 1.0;
|
||||
switch(style) {
|
||||
case FILLED_ARROW:
|
||||
|
||||
Reference in New Issue
Block a user