LGTM: [skip ci] fix: Large object passed by value

This commit is contained in:
wmayer
2020-07-24 18:32:31 +02:00
parent 75ba0b8a77
commit d5d7d65bfc
20 changed files with 48 additions and 48 deletions

View File

@@ -439,7 +439,7 @@ bool DrawUtil::vectorLess(const Base::Vector3d& v1, const Base::Vector3d& v2)
}
//!convert fromPoint in coordinate system fromSystem to reference coordinate system
Base::Vector3d DrawUtil::toR3(const gp_Ax2 fromSystem, const Base::Vector3d fromPoint)
Base::Vector3d DrawUtil::toR3(const gp_Ax2& fromSystem, const Base::Vector3d& fromPoint)
{
gp_Pnt gFromPoint(fromPoint.x,fromPoint.y,fromPoint.z);
gp_Pnt gToPoint;
@@ -1247,7 +1247,7 @@ QString DrawUtil::qbaToDebug(const QByteArray & line)
}
void DrawUtil::dumpCS(const char* text,
gp_Ax2 CS)
const gp_Ax2& CS)
{
gp_Dir baseAxis = CS.Direction();
gp_Dir baseX = CS.XDirection();
@@ -1261,7 +1261,7 @@ void DrawUtil::dumpCS(const char* text,
}
void DrawUtil::dumpCS3(const char* text,
gp_Ax3 CS)
const gp_Ax3& CS)
{
gp_Dir baseAxis = CS.Direction();
gp_Dir baseX = CS.XDirection();

View File

@@ -93,7 +93,7 @@ class TechDrawExport DrawUtil {
static std::string formatVector(const QPointF& v);
static bool vectorLess(const Base::Vector3d& v1, const Base::Vector3d& v2);
static Base::Vector3d toR3(const gp_Ax2 fromSystem, const Base::Vector3d fromPoint);
static Base::Vector3d toR3(const gp_Ax2& fromSystem, const Base::Vector3d& fromPoint);
static bool checkParallel(const Base::Vector3d v1, const Base::Vector3d v2, double tolerance = FLT_EPSILON);
//! rotate vector by angle radians around axis through org
static Base::Vector3d vecRotate(Base::Vector3d vec,
@@ -172,8 +172,8 @@ class TechDrawExport DrawUtil {
static void countEdges(const char* label, const TopoDS_Shape& s);
static const char* printBool(bool b);
static QString qbaToDebug(const QByteArray& line);
static void dumpCS(const char* text, gp_Ax2 CS);
static void dumpCS3(const char* text, gp_Ax3 CS);
static void dumpCS(const char* text, const gp_Ax2& CS);
static void dumpCS3(const char* text, const gp_Ax3& CS);
static void dumpEdges(const char* text, const TopoDS_Shape& s);
};

View File

@@ -172,7 +172,7 @@ void GeometryObject::clear()
//!set up a hidden line remover and project a shape with it
void GeometryObject::projectShape(const TopoDS_Shape& input,
const gp_Ax2 viewAxis)
const gp_Ax2& viewAxis)
{
// Base::Console().Message("GO::projectShape() - %s\n", m_parentName.c_str());
// Clear previous Geometry
@@ -295,7 +295,7 @@ TopoDS_Shape GeometryObject::invertGeometry(const TopoDS_Shape s)
//!set up a hidden line remover and project a shape with it
void GeometryObject::projectShapeWithPolygonAlgo(const TopoDS_Shape& input,
const gp_Ax2 viewAxis)
const gp_Ax2 &viewAxis)
{
// Clear previous Geometry
clear();
@@ -404,7 +404,7 @@ void GeometryObject::projectShapeWithPolygonAlgo(const TopoDS_Shape& input,
}
TopoDS_Shape GeometryObject::projectFace(const TopoDS_Shape &face,
const gp_Ax2 CS)
const gp_Ax2 &CS)
{
// Base::Console().Message("GO::projectFace()\n");
if(face.IsNull()) {
@@ -939,7 +939,7 @@ gp_Pnt TechDraw::findCentroid(const TopoDS_Shape &shape,
//! Returns the centroid of shape, as viewed according to direction
gp_Pnt TechDraw::findCentroid(const TopoDS_Shape &shape,
const gp_Ax2 viewAxis)
const gp_Ax2 &viewAxis)
{
// Base::Console().Message("GO::findCentroid() - 2\n");
// Base::Vector3d origin(0.0,0.0,0.0);
@@ -976,7 +976,7 @@ Base::Vector3d TechDraw::findCentroidVec(const TopoDS_Shape &shape,
}
Base::Vector3d TechDraw::findCentroidVec(const TopoDS_Shape &shape,
const gp_Ax2 cs)
const gp_Ax2 &cs)
{
// Base::Console().Message("GO::findCentroidVec() - 2\n");
gp_Pnt p = TechDraw::findCentroid(shape,cs);

View File

@@ -75,11 +75,11 @@ TopoDS_Shape TechDrawExport moveShape(const TopoDS_Shape &input,
gp_Pnt TechDrawExport findCentroid(const TopoDS_Shape &shape,
const Base::Vector3d &direction);
gp_Pnt TechDrawExport findCentroid(const TopoDS_Shape &shape,
const gp_Ax2 viewAxis);
const gp_Ax2 &viewAxis);
Base::Vector3d TechDrawExport findCentroidVec(const TopoDS_Shape &shape,
const Base::Vector3d &direction);
Base::Vector3d TechDrawExport findCentroidVec(const TopoDS_Shape &shape,
const gp_Ax2 cs);
const gp_Ax2& cs);
gp_Ax2 TechDrawExport getViewAxis(const Base::Vector3d origin,
const Base::Vector3d& direction,
@@ -113,11 +113,11 @@ public:
void setEdgeGeometry(std::vector<BaseGeom*> newGeoms) {edgeGeom = newGeoms; }
void projectShape(const TopoDS_Shape &input,
const gp_Ax2 viewAxis);
const gp_Ax2 &viewAxis);
void projectShapeWithPolygonAlgo(const TopoDS_Shape &input,
const gp_Ax2 viewAxis);
const gp_Ax2 &viewAxis);
TopoDS_Shape projectFace(const TopoDS_Shape &face,
const gp_Ax2 CS);
const gp_Ax2 &CS);
void extractGeometry(edgeClass category, bool visible);
void addFaceGeom(Face * f);

View File

@@ -115,10 +115,10 @@ public:
LineSet() {}
~LineSet() {}
void setPATLineSpec(PATLineSpec s) { m_hatchLine = s; }
void setPATLineSpec(const PATLineSpec& s) { m_hatchLine = s; }
void setEdges(std::vector<TopoDS_Edge> e) {m_edges = e;}
void setGeoms(std::vector<TechDraw::BaseGeom*> g) {m_geoms = g;}
void setBBox(Bnd_Box bb) {m_box = bb;}
void setBBox(const Bnd_Box& bb) {m_box = bb;}
std::vector<TopoDS_Edge> getEdges(void) { return m_edges; }
TopoDS_Edge getEdge(int i) {return m_edges.at(i);}