Performance Ph2

This commit is contained in:
WandererFan
2016-10-02 20:43:24 -04:00
committed by Yorik van Havre
parent 3cf036de4c
commit 001bbf52d6
9 changed files with 352 additions and 186 deletions

View File

@@ -65,11 +65,13 @@
#include <Mod/Part/App/PartFeature.h>
#include "DrawUtil.h"
#include "GeometryObject.h"
//#include <QDebug>
using namespace TechDrawGeometry;
using namespace TechDraw;
using namespace std;
struct EdgePoints {
@@ -79,10 +81,11 @@ struct EdgePoints {
//debugging routine signatures
const char* _printBool(bool b);
void _dumpEdge(char* label, int i, TopoDS_Edge e);
GeometryObject::GeometryObject() : Tolerance(0.05f), Scale(1.f)
GeometryObject::GeometryObject(DrawView* parent) :
Tolerance(0.05f),
Scale(1.f),
m_parent(parent)
{
}
@@ -157,7 +160,8 @@ void GeometryObject::projectShape(const TopoDS_Shape& input,
auto end = chrono::high_resolution_clock::now();
auto diff = end - start;
double diffOut = chrono::duration <double, milli> (diff).count();
Base::Console().Log("TIMING - GO spent: %.3f millisecs in HLRBRep_Algo & co\n",diffOut);
Base::Console().Log("TIMING - %s GO spent: %.3f millisecs in HLRBRep_Algo & co\n",m_parent->getNameInDocument(),diffOut);
try {
HLRBRep_HLRToShape hlrToShape(brep_hlr);
@@ -244,7 +248,11 @@ void GeometryObject::addGeomFromCompound(TopoDS_Shape edgeCompound, edgeClass ca
for (int i = 1 ; edges.More(); edges.Next(),i++) {
const TopoDS_Edge& edge = TopoDS::Edge(edges.Current());
if (edge.IsNull()) {
Base::Console().Log("INFO - GO::addGeomFromCompound - edge: %d is NULL\n",i);
//Base::Console().Log("INFO - GO::addGeomFromCompound - edge: %d is NULL\n",i);
continue;
}
if (DrawUtil::isZeroEdge(edge)) {
Base::Console().Log("INFO - GO::addGeomFromCompound - edge: %d is zeroEdge\n",i);
continue;
}
base = BaseGeom::baseFactory(edge);
@@ -702,18 +710,6 @@ void debugEdge(const TopoDS_Edge &e)
}*/
void _dumpEdge(char* label, int i, TopoDS_Edge e)
{
BRepAdaptor_Curve adapt(e);
double start = BRepLProp_CurveTool::FirstParameter(adapt);
double end = BRepLProp_CurveTool::LastParameter(adapt);
BRepLProp_CLProps propStart(adapt,start,0,Precision::Confusion());
const gp_Pnt& vStart = propStart.Value();
BRepLProp_CLProps propEnd(adapt,end,0,Precision::Confusion());
const gp_Pnt& vEnd = propEnd.Value();
Base::Console().Message("%s edge:%d start:(%.3f,%.3f,%.3f)/%0.3f end:(%.2f,%.3f,%.3f)/%.3f\n",label,i,
vStart.X(),vStart.Y(),vStart.Z(),start,vEnd.X(),vEnd.Y(),vEnd.Z(),end);
}
const char* _printBool(bool b)
{