[TD]CI clang warnings
This commit is contained in:
@@ -48,29 +48,29 @@ using namespace TechDraw;
|
||||
|
||||
double LineSet::getMinX()
|
||||
{
|
||||
double xMin,yMin,zMin,xMax,yMax,zMax;
|
||||
m_box.Get(xMin,yMin,zMin,xMax,yMax,zMax);
|
||||
double xMin, yMin, zMin, xMax, yMax, zMax;
|
||||
m_box.Get(xMin, yMin, zMin, xMax, yMax, zMax);
|
||||
return xMin;
|
||||
}
|
||||
|
||||
double LineSet::getMinY()
|
||||
{
|
||||
double xMin,yMin,zMin,xMax,yMax,zMax;
|
||||
m_box.Get(xMin,yMin,zMin,xMax,yMax,zMax);
|
||||
double xMin, yMin, zMin, xMax, yMax, zMax;
|
||||
m_box.Get(xMin, yMin, zMin, xMax, yMax, zMax);
|
||||
return yMin;
|
||||
}
|
||||
|
||||
double LineSet::getMaxX()
|
||||
{
|
||||
double xMin,yMin,zMin,xMax,yMax,zMax;
|
||||
m_box.Get(xMin,yMin,zMin,xMax,yMax,zMax);
|
||||
double xMin, yMin, zMin, xMax, yMax, zMax;
|
||||
m_box.Get(xMin, yMin, zMin, xMax, yMax, zMax);
|
||||
return xMax;
|
||||
}
|
||||
|
||||
double LineSet::getMaxY()
|
||||
{
|
||||
double xMin,yMin,zMin,xMax,yMax,zMax;
|
||||
m_box.Get(xMin,yMin,zMin,xMax,yMax,zMax);
|
||||
double xMin, yMin, zMin, xMax, yMax, zMax;
|
||||
m_box.Get(xMin, yMin, zMin, xMax, yMax, zMax);
|
||||
return yMax;
|
||||
}
|
||||
|
||||
@@ -84,18 +84,18 @@ bool LineSet::isDashed()
|
||||
Base::Vector3d LineSet::calcApparentStart(TechDraw::BaseGeomPtr g)
|
||||
{
|
||||
Base::Vector3d result;
|
||||
Base::Vector3d start(g->getStartPoint().x,g->getStartPoint().y,0.0);
|
||||
Base::Vector3d start(g->getStartPoint().x, g->getStartPoint().y, 0.0);
|
||||
double angle = getPATLineSpec().getAngle();
|
||||
if (angle == 0.0) { //horizontal
|
||||
result = Base::Vector3d(getMinX(),start.y,0.0);
|
||||
result = Base::Vector3d(getMinX(), start.y, 0.0);
|
||||
} else if ((angle == 90.0) ||
|
||||
(angle == -90.0)) { //vertical
|
||||
result = Base::Vector3d(start.x,getMinY(),0.0);
|
||||
result = Base::Vector3d(start.x, getMinY(), 0.0);
|
||||
} else {
|
||||
double slope = getPATLineSpec().getSlope();
|
||||
double y = getMinY();
|
||||
double x = ((y - start.y) / slope) + start.x;
|
||||
result = Base::Vector3d(x,y,0);
|
||||
result = Base::Vector3d(x, y,0);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -118,16 +118,16 @@ Base::Vector3d LineSet::getUnitOrtho()
|
||||
{
|
||||
Base::Vector3d result;
|
||||
Base::Vector3d unit = getUnitDir();
|
||||
Base::Vector3d X(1.0,0.0,0.0);
|
||||
Base::Vector3d Y(0.0,1.0,0.0);
|
||||
if (unit.IsEqual(X,0.000001)) {
|
||||
Base::Vector3d X(1.0, 0.0, 0.0);
|
||||
Base::Vector3d Y(0.0, 1.0, 0.0);
|
||||
if (unit.IsEqual(X, 0.000001)) {
|
||||
result = Y;
|
||||
} else if (unit.IsEqual(Y,0.000001)) {
|
||||
} else if (unit.IsEqual(Y, 0.000001)) {
|
||||
result = X;
|
||||
} else {
|
||||
double unitX = unit.x;
|
||||
double unitY = unit.y;
|
||||
result = Base::Vector3d(unitY,-unitX, 0.0); //perpendicular
|
||||
result = Base::Vector3d(unitY, -unitX, 0.0); //perpendicular
|
||||
}
|
||||
result.Normalize(); //probably redundant
|
||||
return result;
|
||||
@@ -140,14 +140,14 @@ Base::Vector3d LineSet::findAtomStart()
|
||||
Base::Vector3d origin = getOrigin();
|
||||
double angle = getAngle();
|
||||
if (angle == 0.0) {
|
||||
result = Base::Vector3d(getMinX(),origin.y,0.0);
|
||||
result = Base::Vector3d(getMinX(), origin.y, 0.0);
|
||||
} else if ( (angle == 90.0) ||
|
||||
(angle == -90.0) ) {
|
||||
result = Base::Vector3d(origin.x,getMinY(),0.0);
|
||||
result = Base::Vector3d(origin.x, getMinY(), 0.0);
|
||||
} else {
|
||||
double minY = getMinY();
|
||||
double x = origin.x - (origin.y - minY)/getSlope();
|
||||
result = Base::Vector3d(x,minY,0.0);
|
||||
result = Base::Vector3d(x, minY, 0.0);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -160,7 +160,7 @@ Base::Vector3d LineSet::getPatternStartPoint(TechDraw::BaseGeomPtr g, double &of
|
||||
double angle = getAngle();
|
||||
double patternLength = scale * getPatternLength();
|
||||
Base::Vector3d lineOrigin;
|
||||
double distX,distY;
|
||||
double distX, distY;
|
||||
int overlayIndex = 0;
|
||||
//interval & offset are not patternscaled
|
||||
|
||||
@@ -168,7 +168,7 @@ Base::Vector3d LineSet::getPatternStartPoint(TechDraw::BaseGeomPtr g, double &of
|
||||
if (angle == 0.0) { //odd case - horizontal line
|
||||
distY = (thisStart.y - atomStart.y); //this is patternscaled
|
||||
overlayIndex = (int) round(distY/(scale * getIntervalY())); //this is +/-
|
||||
lineOrigin = getOrigin() + distY * Base::Vector3d(0.0,1.0,0.0); //move u/d
|
||||
lineOrigin = getOrigin() + distY * Base::Vector3d(0.0, 1.0, 0.0); //move u/d
|
||||
} else {
|
||||
distX = (thisStart.x - atomStart.x); //this is patternscaled
|
||||
overlayIndex = (int) round(distX/(scale * getIntervalX()));
|
||||
@@ -197,7 +197,7 @@ Base::Vector3d LineSet::getPatternStartPoint(TechDraw::BaseGeomPtr g, double &of
|
||||
double patsEndOrg = lenEndOrg/patternLength;
|
||||
if (lenStartOrg < lenEndOrg) { //origin is before start
|
||||
double c = ceil(patsStartOrg);
|
||||
if (c <= patsEndOrg) { //c is an integer pattern count in [patsStartOrg,patsEndOrg]
|
||||
if (c <= patsEndOrg) { //c is an integer pattern count in [patsStartOrg, patsEndOrg]
|
||||
result = lineOrigin + c*patternLength*getUnitDir();
|
||||
offset = 0.0;
|
||||
} else {
|
||||
@@ -208,7 +208,7 @@ Base::Vector3d LineSet::getPatternStartPoint(TechDraw::BaseGeomPtr g, double &of
|
||||
}
|
||||
} else if (lenStartOrg > lenEndOrg) { //origin is after end
|
||||
double c = ceil(patsEndOrg);
|
||||
if (c <= patsStartOrg) { //c is an integer pattern count in [patsStartOrg,patsEndOrg]
|
||||
if (c <= patsStartOrg) { //c is an integer pattern count in [patsStartOrg, patsEndOrg]
|
||||
result = lineOrigin - c*patternLength*getUnitDir();
|
||||
offset = 0.0;
|
||||
} else {
|
||||
@@ -243,7 +243,7 @@ PATLineSpec::~PATLineSpec()
|
||||
void PATLineSpec::init()
|
||||
{
|
||||
m_angle = 0.0;
|
||||
m_origin = Base::Vector3d(0.0,0.0,0.0);
|
||||
m_origin = Base::Vector3d(0.0, 0.0, 0.0);
|
||||
m_interval = 1.0;
|
||||
m_offset = 0.0;
|
||||
}
|
||||
@@ -252,11 +252,11 @@ void PATLineSpec::load(std::string& lineSpec)
|
||||
{
|
||||
std::vector<double> values = split(lineSpec);
|
||||
if (values.size() < 5) {
|
||||
Base::Console().Message( "PATLineSpec::load(%s) invalid entry in pattern\n",lineSpec.c_str() );
|
||||
Base::Console().Message( "PATLineSpec::load(%s) invalid entry in pattern\n", lineSpec.c_str() );
|
||||
return;
|
||||
}
|
||||
m_angle = values[0];
|
||||
m_origin = Base::Vector3d(values[1],values[2],0.0);
|
||||
m_origin = Base::Vector3d(values[1], values[2], 0.0);
|
||||
m_offset = values[3];
|
||||
m_interval = values[4];
|
||||
if (values.size() > 5) {
|
||||
@@ -272,13 +272,13 @@ std::vector<double> PATLineSpec::split(std::string line)
|
||||
std::stringstream lineStream(line);
|
||||
std::string cell;
|
||||
|
||||
while(std::getline(lineStream,cell, ','))
|
||||
while(std::getline(lineStream, cell, ','))
|
||||
{
|
||||
try {
|
||||
result.push_back(std::stod(cell));
|
||||
}
|
||||
catch (const std::invalid_argument& ia) {
|
||||
Base::Console().Warning("Invalid number in cell: %s (%s) \n",cell.c_str(),ia.what());
|
||||
Base::Console().Warning("Invalid number in cell: %s (%s) \n", cell.c_str(), ia.what());
|
||||
result.push_back(0.0);
|
||||
}
|
||||
}
|
||||
@@ -287,17 +287,17 @@ std::vector<double> PATLineSpec::split(std::string line)
|
||||
|
||||
void PATLineSpec::dump(const char* title)
|
||||
{
|
||||
Base::Console().Message( "DUMP: %s\n",title);
|
||||
Base::Console().Message( "DUMP: %s\n", title);
|
||||
Base::Console().Message( "Angle: %.3f\n", m_angle);
|
||||
Base::Console().Message( "Origin: %s\n",DrawUtil::formatVector(m_origin).c_str());
|
||||
Base::Console().Message( "Offset: %.3f\n",m_offset);
|
||||
Base::Console().Message( "Interval: %.3f\n",m_interval);
|
||||
Base::Console().Message( "Origin: %s\n", DrawUtil::formatVector(m_origin).c_str());
|
||||
Base::Console().Message( "Offset: %.3f\n", m_offset);
|
||||
Base::Console().Message( "Interval: %.3f\n", m_interval);
|
||||
// std::stringstream ss;
|
||||
// for (auto& d: m_dashParms) {
|
||||
// ss << d << ", ";
|
||||
// }
|
||||
// ss << "end";
|
||||
// Base::Console().Message( "DashSpec: %s\n",ss.str().c_str());
|
||||
// Base::Console().Message( "DashSpec: %s\n", ss.str().c_str());
|
||||
m_dashParms.dump("dashspec");
|
||||
}
|
||||
|
||||
@@ -320,7 +320,7 @@ std::vector<PATLineSpec> PATLineSpec::getSpecsForPattern(std::string& parmFile,
|
||||
lineSpecs = loadPatternDef(inFile);
|
||||
} else {
|
||||
//this message can come up when changing PAT file or pattern name
|
||||
Base::Console().Log( "Could not find pattern: %s\n",parmName.c_str() );
|
||||
Base::Console().Log( "Could not find pattern: %s\n", parmName.c_str() );
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -338,8 +338,8 @@ bool PATLineSpec::findPatternStart(std::ifstream& inFile, std::string& parmName
|
||||
bool result = false;
|
||||
while ( inFile.good() ){
|
||||
std::string line;
|
||||
std::getline(inFile,line);
|
||||
std::string nameTag = line.substr(0,1);
|
||||
std::getline(inFile, line);
|
||||
std::string nameTag = line.substr(0, 1);
|
||||
std::string patternName;
|
||||
std::size_t commaPos;
|
||||
if ((nameTag == ";") ||
|
||||
@@ -349,7 +349,7 @@ bool PATLineSpec::findPatternStart(std::ifstream& inFile, std::string& parmName
|
||||
} else if (nameTag == "*") {
|
||||
commaPos = line.find(',',1);
|
||||
if (commaPos != std::string::npos) {
|
||||
patternName = line.substr(1,commaPos-1);
|
||||
patternName = line.substr(1, commaPos-1);
|
||||
} else {
|
||||
patternName = line.substr(1);
|
||||
}
|
||||
@@ -369,8 +369,8 @@ std::vector<std::string> PATLineSpec::loadPatternDef(std::ifstream& inFile)
|
||||
std::vector<std::string> result;
|
||||
while ( inFile.good() ){
|
||||
std::string line;
|
||||
std::getline(inFile,line);
|
||||
std::string nameTag = line.substr(0,1);
|
||||
std::getline(inFile, line);
|
||||
std::string nameTag = line.substr(0, 1);
|
||||
if ((nameTag == ";") ||
|
||||
(nameTag == " ") ||
|
||||
(line.empty()) ) { //is cr/lf empty?
|
||||
@@ -397,14 +397,14 @@ std::vector<std::string> PATLineSpec::getPatternList(std::string& parmFile)
|
||||
|
||||
while ( inFile.good() ){
|
||||
std::string line;
|
||||
std::getline(inFile,line);
|
||||
std::string nameTag = line.substr(0,1); //dupl code here
|
||||
std::getline(inFile, line);
|
||||
std::string nameTag = line.substr(0, 1); //dupl code here
|
||||
std::size_t commaPos;
|
||||
if (nameTag == "*") { //found a pattern
|
||||
commaPos = line.find(',',1);
|
||||
std::string patternName;
|
||||
if (commaPos != std::string::npos) {
|
||||
patternName = line.substr(1,commaPos-1);
|
||||
patternName = line.substr(1, commaPos-1);
|
||||
} else {
|
||||
patternName = line.substr(1);
|
||||
}
|
||||
@@ -475,7 +475,7 @@ double DashSpec::length()
|
||||
DashSpec DashSpec::reversed()
|
||||
{
|
||||
std::vector<double> p = get();
|
||||
std::reverse(p.begin(),p.end());
|
||||
std::reverse(p.begin(), p.end());
|
||||
DashSpec result(p);
|
||||
return result;
|
||||
}
|
||||
@@ -487,7 +487,7 @@ void DashSpec::dump(const char* title)
|
||||
for (auto& p: m_parms) {
|
||||
ss << p << ", ";
|
||||
}
|
||||
Base::Console().Message("DUMP - DashSpec - %s\n",ss.str().c_str());
|
||||
Base::Console().Message("DUMP - DashSpec - %s\n", ss.str().c_str());
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user