[TD]const-ness for dump function parameter
This commit is contained in:
@@ -86,7 +86,7 @@ LineFormat::LineFormat(int style,
|
||||
{
|
||||
}
|
||||
|
||||
void LineFormat::dump(char* title)
|
||||
void LineFormat::dump(const char* title)
|
||||
{
|
||||
Base::Console().Message("LF::dump - %s \n",title);
|
||||
Base::Console().Message("LF::dump - %s \n",toString().c_str());
|
||||
@@ -326,7 +326,7 @@ PyObject* CosmeticVertex::getPyObject(void)
|
||||
return new CosmeticVertexPy(new CosmeticVertex(this->copy()));
|
||||
}
|
||||
|
||||
void CosmeticVertex::dump(char* title)
|
||||
void CosmeticVertex::dump(const char* title)
|
||||
{
|
||||
Base::Console().Message("CV::dump - %s \n",title);
|
||||
Base::Console().Message("CV::dump - %s \n",toString().c_str());
|
||||
@@ -426,7 +426,7 @@ std::string CosmeticEdge::toString(void) const
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
void CosmeticEdge::dump(char* title)
|
||||
void CosmeticEdge::dump(const char* title)
|
||||
{
|
||||
Base::Console().Message("CE::dump - %s \n",title);
|
||||
Base::Console().Message("CE::dump - %s \n",toString().c_str());
|
||||
@@ -808,7 +808,7 @@ std::string CenterLine::toString(void) const
|
||||
return clCSV + ",$$$," + fmtCSV;
|
||||
}
|
||||
|
||||
void CenterLine::dump(char* title)
|
||||
void CenterLine::dump(const char* title)
|
||||
{
|
||||
Base::Console().Message("CL::dump - %s \n",title);
|
||||
Base::Console().Message("CL::dump - %s \n",toString().c_str());
|
||||
@@ -1476,7 +1476,7 @@ GeomFormat::~GeomFormat()
|
||||
{
|
||||
}
|
||||
|
||||
void GeomFormat::dump(char* title) const
|
||||
void GeomFormat::dump(const char* title) const
|
||||
{
|
||||
Base::Console().Message("GF::dump - %s \n",title);
|
||||
Base::Console().Message("GF::dump - %s \n",toString().c_str());
|
||||
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
static App::Color getDefEdgeColor();
|
||||
static int getDefEdgeStyle();
|
||||
|
||||
void dump(char* title);
|
||||
void dump(const char* title);
|
||||
std::string toString() const;
|
||||
};
|
||||
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
virtual ~CosmeticVertex() = default;
|
||||
|
||||
std::string toString(void) const;
|
||||
void dump(char* title);
|
||||
void dump(const char* title);
|
||||
Base::Vector3d scaled(double factor);
|
||||
|
||||
static bool restoreCosmetic(void);
|
||||
@@ -125,7 +125,7 @@ public:
|
||||
|
||||
virtual std::string toString(void) const;
|
||||
/* virtual bool fromCSV(std::string& lineSpec);*/
|
||||
void dump(char* title);
|
||||
void dump(const char* title);
|
||||
|
||||
// Persistence implementer ---------------------
|
||||
virtual unsigned int getMemSize(void) const;
|
||||
@@ -213,7 +213,7 @@ public:
|
||||
int vert, double ext,
|
||||
double m_hShift, double m_vShift,
|
||||
double rotate, bool flip);
|
||||
void dump(char* title);
|
||||
void dump(const char* title);
|
||||
void setShifts(double h, double v);
|
||||
double getHShift(void);
|
||||
double getVShift(void);
|
||||
@@ -275,7 +275,7 @@ public:
|
||||
GeomFormat* clone(void) const;
|
||||
|
||||
std::string toString(void) const;
|
||||
void dump(char* title) const;
|
||||
void dump(const char* title) const;
|
||||
|
||||
int m_geomIndex;
|
||||
LineFormat m_format;
|
||||
|
||||
@@ -71,10 +71,10 @@ DrawProjGroup::DrawProjGroup(void)
|
||||
Source.setScope(App::LinkScope::Global);
|
||||
ADD_PROPERTY_TYPE(Anchor, (0), group, App::Prop_None, "The root view to align projections with");
|
||||
Anchor.setScope(App::LinkScope::Global);
|
||||
|
||||
|
||||
|
||||
|
||||
ProjectionType.setEnums(ProjectionTypeEnums);
|
||||
ADD_PROPERTY_TYPE(ProjectionType, ((long)getDefProjConv()), group,
|
||||
ADD_PROPERTY_TYPE(ProjectionType, ((long)getDefProjConv()), group,
|
||||
App::Prop_None, "First or Third Angle projection");
|
||||
|
||||
ADD_PROPERTY_TYPE(AutoDistribute ,(autoDist),agroup,
|
||||
@@ -124,7 +124,7 @@ void DrawProjGroup::onChanged(const App::Property* prop)
|
||||
if (prop == &LockPosition) {
|
||||
updateChildrenLock();
|
||||
}
|
||||
|
||||
|
||||
if (prop == &ScaleType) {
|
||||
double newScale = getScale();
|
||||
if (ScaleType.isValue("Automatic")) {
|
||||
@@ -280,7 +280,7 @@ double DrawProjGroup::calculateAutomaticScale() const
|
||||
Base::Console().Log("DPG - %s - bad scale found (%.3f) using 1.0\n",getNameInDocument(),result);
|
||||
result = 1.0;
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -343,7 +343,7 @@ DrawProjGroupItem* DrawProjGroup::getProjItem(const char *viewProjType) const
|
||||
auto result( dynamic_cast<TechDraw::DrawProjGroupItem *>(docObj) );
|
||||
if ( (result == nullptr) &&
|
||||
(docObj != nullptr) ) {
|
||||
//should never have a item in DPG that is not a DPGI.
|
||||
//should never have a item in DPG that is not a DPGI.
|
||||
Base::Console().Log("PROBLEM - DPG::getProjItem finds non-DPGI in Group %s / %s\n",
|
||||
getNameInDocument(),viewProjType);
|
||||
throw Base::TypeError("Error: projection in DPG list is not a DPGI!");
|
||||
@@ -376,7 +376,7 @@ bool DrawProjGroup::hasProjection(const char *viewProjType) const
|
||||
for( const auto it : Views.getValues() ) {
|
||||
auto view( dynamic_cast<TechDraw::DrawProjGroupItem *>(it) );
|
||||
if (view == nullptr) {
|
||||
//should never have a item in DPG that is not a DPGI.
|
||||
//should never have a item in DPG that is not a DPGI.
|
||||
Base::Console().Log("PROBLEM - DPG::hasProjection finds non-DPGI in Group %s / %s\n",
|
||||
getNameInDocument(),viewProjType);
|
||||
throw Base::TypeError("Error: projection in DPG list is not a DPGI!");
|
||||
@@ -406,7 +406,7 @@ App::DocumentObject * DrawProjGroup::addProjection(const char *viewProjType)
|
||||
view = dynamic_cast<TechDraw::DrawProjGroupItem *>(docObj);
|
||||
if ( (view == nullptr) &&
|
||||
(docObj != nullptr) ) {
|
||||
//should never happen that we create a DPGI that isn't a DPGI!!
|
||||
//should never happen that we create a DPGI that isn't a DPGI!!
|
||||
Base::Console().Log("PROBLEM - DPG::addProjection - created a non DPGI! %s / %s\n",
|
||||
getNameInDocument(),viewProjType);
|
||||
throw Base::TypeError("Error: new projection is not a DPGI!");
|
||||
@@ -514,12 +514,12 @@ std::pair<Base::Vector3d,Base::Vector3d> DrawProjGroup::getDirsFromFront(std::st
|
||||
Base::Console().Warning("DPG::getDirsFromFront - %s - No Anchor!\n",Label.getValue());
|
||||
throw Base::RuntimeError("Project Group missing Anchor projection item");
|
||||
}
|
||||
|
||||
|
||||
Base::Vector3d dirAnch = anch->Direction.getValue();
|
||||
Base::Vector3d rotAnch = anch->RotationVector.getValue();
|
||||
Base::Vector3d upAnch = dirAnch.Cross(rotAnch); //this can get weird after rotations
|
||||
projDir = dirAnch; //need default
|
||||
rotVec = rotAnch;
|
||||
rotVec = rotAnch;
|
||||
Base::Vector3d realUp = DrawUtil::closestBasis(upAnch);
|
||||
|
||||
Base::Vector3d org(0.0,0.0,0.0);
|
||||
@@ -655,7 +655,7 @@ Base::Vector3d DrawProjGroup::getXYPosition(const char *viewTypeCStr)
|
||||
position[5].x = bigCol + xSpacing;
|
||||
position[5].y = 0.0;
|
||||
}
|
||||
if (viewPtrs[6] &&
|
||||
if (viewPtrs[6] &&
|
||||
bboxes[6].IsValid()) { //"Rear"
|
||||
if (viewPtrs[5] &&
|
||||
bboxes[5].IsValid()) {
|
||||
@@ -667,9 +667,9 @@ Base::Vector3d DrawProjGroup::getXYPosition(const char *viewTypeCStr)
|
||||
position[6].y = 0.0;
|
||||
}
|
||||
}
|
||||
if (viewPtrs[7] &&
|
||||
if (viewPtrs[7] &&
|
||||
bboxes[7].IsValid()) { //iso
|
||||
position[7].x = -bigCol - xSpacing;
|
||||
position[7].x = -bigCol - xSpacing;
|
||||
position[7].y = -bigRow - ySpacing;
|
||||
}
|
||||
if (viewPtrs[8] && // B/T
|
||||
@@ -876,7 +876,7 @@ void DrawProjGroup::autoPositionChildren(void)
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
/*!
|
||||
* tell children DPGIs that parent DPG has changed Scale
|
||||
*/
|
||||
void DrawProjGroup::updateChildrenScale(void)
|
||||
@@ -895,7 +895,7 @@ void DrawProjGroup::updateChildrenScale(void)
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
/*!
|
||||
* tell children DPGIs that parent DPG has changed Source
|
||||
*/
|
||||
void DrawProjGroup::updateChildrenSource(void)
|
||||
@@ -913,7 +913,7 @@ void DrawProjGroup::updateChildrenSource(void)
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
/*!
|
||||
* tell children DPGIs that parent DPG has changed LockPosition
|
||||
* (really for benefit of QGIV on Gui side)
|
||||
*/
|
||||
@@ -1036,7 +1036,7 @@ void DrawProjGroup::updateSecondaryDirs()
|
||||
Base::Vector3d anchDir = anchor->Direction.getValue();
|
||||
Base::Vector3d anchRot = anchor->RotationVector.getValue();
|
||||
|
||||
std::map<std::string, std::pair<Base::Vector3d,Base::Vector3d> > saveVals;
|
||||
std::map<std::string, std::pair<Base::Vector3d,Base::Vector3d> > saveVals;
|
||||
std::string key;
|
||||
std::pair<Base::Vector3d, Base::Vector3d> data;
|
||||
for (auto& docObj: Views.getValues()) {
|
||||
@@ -1047,7 +1047,7 @@ void DrawProjGroup::updateSecondaryDirs()
|
||||
DrawProjGroupItem* v = static_cast<DrawProjGroupItem*>(docObj);
|
||||
ProjItemType t = static_cast<ProjItemType>(v->Type.getValue());
|
||||
switch (t) {
|
||||
case Front :
|
||||
case Front :
|
||||
data.first = anchDir;
|
||||
data.second = anchRot;
|
||||
key = "Front";
|
||||
@@ -1174,7 +1174,7 @@ void DrawProjGroup::rotateUp()
|
||||
anchor->RotationVector.setValue(newDirs.second);
|
||||
updateSecondaryDirs();
|
||||
}
|
||||
|
||||
|
||||
void DrawProjGroup::rotateDown()
|
||||
{
|
||||
//Front -> Bottom -> Rear -> Top -> Front
|
||||
@@ -1192,20 +1192,20 @@ void DrawProjGroup::spinCW()
|
||||
DrawProjGroupItem* anchor = getAnchor();
|
||||
double angle = M_PI / 2.0;
|
||||
Base::Vector3d org(0.0,0.0,0.0);
|
||||
Base::Vector3d curRot = anchor->RotationVector.getValue();
|
||||
Base::Vector3d curRot = anchor->RotationVector.getValue();
|
||||
Base::Vector3d curDir = anchor->Direction.getValue();
|
||||
Base::Vector3d newRot = DrawUtil::vecRotate(curRot,angle,curDir,org);
|
||||
anchor->RotationVector.setValue(newRot);
|
||||
updateSecondaryDirs();
|
||||
}
|
||||
|
||||
|
||||
void DrawProjGroup::spinCCW()
|
||||
{
|
||||
//Top -> Left -> Bottom -> Right -> Top
|
||||
DrawProjGroupItem* anchor = getAnchor();
|
||||
double angle = M_PI / 2.0;
|
||||
Base::Vector3d org(0.0,0.0,0.0);
|
||||
Base::Vector3d curRot = anchor->RotationVector.getValue();
|
||||
Base::Vector3d curRot = anchor->RotationVector.getValue();
|
||||
Base::Vector3d curDir = anchor->Direction.getValue();
|
||||
Base::Vector3d newRot = DrawUtil::vecRotate(curRot,-angle,curDir,org);
|
||||
anchor->RotationVector.setValue(newRot);
|
||||
@@ -1233,11 +1233,11 @@ int DrawProjGroup::getDefProjConv(void) const
|
||||
}
|
||||
|
||||
/*!
|
||||
*dumps the current iso DPGI's
|
||||
*dumps the current iso DPGI's
|
||||
*/
|
||||
void DrawProjGroup::dumpISO(char * title)
|
||||
void DrawProjGroup::dumpISO(const char * title)
|
||||
{
|
||||
Base::Console().Message("DPG ISO: %s\n", title);
|
||||
Base::Console().Message("DPG ISO: %s\n", title);
|
||||
for (auto& docObj: Views.getValues()) {
|
||||
Base::Vector3d dir;
|
||||
Base::Vector3d axis;
|
||||
@@ -1246,7 +1246,7 @@ void DrawProjGroup::dumpISO(char * title)
|
||||
dir = v->Direction.getValue();
|
||||
axis = v->RotationVector.getValue();
|
||||
|
||||
Base::Console().Message("%s: %s/%s\n",
|
||||
Base::Console().Message("%s: %s/%s\n",
|
||||
t.c_str(),DrawUtil::formatVector(dir).c_str(),DrawUtil::formatVector(axis).c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ public:
|
||||
void spinCW(void);
|
||||
void spinCCW(void);
|
||||
|
||||
void dumpISO(char * title);
|
||||
void dumpISO(const char * title);
|
||||
std::vector<DrawProjGroupItem*> getViewsAsDPGI();
|
||||
|
||||
void recomputeChildren(void);
|
||||
|
||||
@@ -203,7 +203,7 @@ double DrawUtil::angleWithX(TopoDS_Edge e, bool reverse)
|
||||
return result;
|
||||
}
|
||||
|
||||
//! find angle of edge with x-Axis at First/LastVertex
|
||||
//! find angle of edge with x-Axis at First/LastVertex
|
||||
double DrawUtil::angleWithX(TopoDS_Edge e, TopoDS_Vertex v, double tolerance)
|
||||
{
|
||||
double result = 0;
|
||||
@@ -359,7 +359,7 @@ std::string DrawUtil::formatVector(const QPointF& v)
|
||||
}
|
||||
|
||||
//! compare 2 vectors for sorting - true if v1 < v2
|
||||
bool DrawUtil::vectorLess(const Base::Vector3d& v1, const Base::Vector3d& v2)
|
||||
bool DrawUtil::vectorLess(const Base::Vector3d& v1, const Base::Vector3d& v2)
|
||||
{
|
||||
bool result = false;
|
||||
if ((v1 - v2).Length() > Precision::Confusion()) { //ie v1 != v2
|
||||
@@ -372,7 +372,7 @@ bool DrawUtil::vectorLess(const Base::Vector3d& v1, const Base::Vector3d& v2)
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
//!convert fromPoint in coordinate system fromSystem to reference coordinate system
|
||||
Base::Vector3d DrawUtil::toR3(const gp_Ax2 fromSystem, const Base::Vector3d fromPoint)
|
||||
@@ -423,7 +423,7 @@ Base::Vector3d DrawUtil::closestBasis(Base::Vector3d v)
|
||||
Base::Vector3d stdYr(0.0,-1.0,0.0);
|
||||
Base::Vector3d stdZr(0.0,0.0,-1.0);
|
||||
double angleX,angleY,angleZ,angleXr,angleYr,angleZr, angleMin;
|
||||
|
||||
|
||||
//first check if already a basis
|
||||
if (checkParallel(v,stdZ)) {
|
||||
return v;
|
||||
@@ -432,7 +432,7 @@ Base::Vector3d DrawUtil::closestBasis(Base::Vector3d v)
|
||||
} else if (checkParallel(v,stdX)) {
|
||||
return v;
|
||||
}
|
||||
|
||||
|
||||
//not a basis. find smallest angle with a basis.
|
||||
angleX = stdX.GetAngle(v);
|
||||
angleY = stdY.GetAngle(v);
|
||||
@@ -501,7 +501,7 @@ double DrawUtil::getDefaultLineWeight(std::string lineType)
|
||||
GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations");
|
||||
std::string lgName = hGrp->GetASCII("LineGroup","FC 0.70mm");
|
||||
auto lg = LineGroup::lineGroupFactory(lgName);
|
||||
|
||||
|
||||
double weight = lg->getWeight(lineType);
|
||||
delete lg; //Coverity CID 174671
|
||||
return weight;
|
||||
@@ -548,7 +548,7 @@ Base::Vector3d DrawUtil::Intersect2d(Base::Vector3d p1, Base::Vector3d d1,
|
||||
|
||||
std::string DrawUtil::shapeToString(TopoDS_Shape s)
|
||||
{
|
||||
std::ostringstream buffer;
|
||||
std::ostringstream buffer;
|
||||
BRepTools::Write(s, buffer);
|
||||
return buffer.str();
|
||||
}
|
||||
@@ -594,7 +594,7 @@ std::vector<std::string> DrawUtil::tokenize(std::string csvLine, std::string del
|
||||
tokens.push_back(s.substr(0, pos));
|
||||
s.erase(0, pos + delimiter.length());
|
||||
}
|
||||
if (!s.empty()) {
|
||||
if (!s.empty()) {
|
||||
tokens.push_back(s);
|
||||
}
|
||||
return tokens;
|
||||
@@ -955,7 +955,7 @@ void DrawUtil::findLineSegmentRectangleIntersections(const Base::Vector2d &lineP
|
||||
}
|
||||
|
||||
// Try to add the line segment end points
|
||||
mergeBoundedPoint(linePoint + segmentBasePosition*segmentDirection,
|
||||
mergeBoundedPoint(linePoint + segmentBasePosition*segmentDirection,
|
||||
rectangle, intersections);
|
||||
mergeBoundedPoint(linePoint + (segmentBasePosition + segmentLength)*segmentDirection,
|
||||
rectangle, intersections);
|
||||
@@ -1044,7 +1044,7 @@ void DrawUtil::dump1Vertex(const char* text, const TopoDS_Vertex& v)
|
||||
Base::Console().Message("%s: (%.3f,%.3f,%.3f)\n",text,pnt.X(),pnt.Y(),pnt.Z());
|
||||
}
|
||||
|
||||
void DrawUtil::dumpEdge(char* label, int i, TopoDS_Edge e)
|
||||
void DrawUtil::dumpEdge(const char* label, int i, TopoDS_Edge e)
|
||||
{
|
||||
BRepAdaptor_Curve adapt(e);
|
||||
double start = BRepLProp_CurveTool::FirstParameter(adapt);
|
||||
|
||||
@@ -158,7 +158,7 @@ class TechDrawExport DrawUtil {
|
||||
|
||||
//debugging routines
|
||||
static void dumpVertexes(const char* text, const TopoDS_Shape& s);
|
||||
static void dumpEdge(char* label, int i, TopoDS_Edge e);
|
||||
static void dumpEdge(const char* label, int i, TopoDS_Edge e);
|
||||
static void dump1Vertex(const char* label, const TopoDS_Vertex& v);
|
||||
static void countFaces(const char* label, const TopoDS_Shape& s);
|
||||
static void countWires(const char* label, const TopoDS_Shape& s);
|
||||
|
||||
@@ -124,9 +124,9 @@ DrawViewDimension::DrawViewDimension(void)
|
||||
Caption.setStatus(App::Property::Hidden,true);
|
||||
|
||||
measurement = new Measure::Measurement();
|
||||
//TODO: should have better initial datumLabel position than (0,0) in the DVP?? something closer to the object being measured?
|
||||
//TODO: should have better initial datumLabel position than (0,0) in the DVP?? something closer to the object being measured?
|
||||
|
||||
//initialize the descriptive geometry.
|
||||
//initialize the descriptive geometry.
|
||||
//TODO: should this be more like DVP with a "geometry object"?
|
||||
m_linearPoints.first = Base::Vector3d(0,0,0);
|
||||
m_linearPoints.second = Base::Vector3d(0,0,0);
|
||||
@@ -272,7 +272,7 @@ App::DocumentObjectExecReturn *DrawViewDimension::execute(void)
|
||||
arcPoints pts;
|
||||
pts.center = Base::Vector3d(0.0,0.0,0.0);
|
||||
pts.radius = 0.0;
|
||||
if( (base && base->geomType == TechDraw::GeomType::CIRCLE) ||
|
||||
if( (base && base->geomType == TechDraw::GeomType::CIRCLE) ||
|
||||
(base && base->geomType == TechDraw::GeomType::ARCOFCIRCLE)) {
|
||||
circle = static_cast<TechDraw::Circle*> (base);
|
||||
pts.center = Base::Vector3d(circle->center.x,circle->center.y,0.0);
|
||||
@@ -304,7 +304,7 @@ App::DocumentObjectExecReturn *DrawViewDimension::execute(void)
|
||||
pts.isArc = false;
|
||||
pts.onCurve.first = pts.center + Base::Vector3d(1,0,0) * rAvg; //arbitrary point on edge
|
||||
pts.onCurve.second = pts.center + Base::Vector3d(-1,0,0) * rAvg; //arbitrary point on edge
|
||||
} else {
|
||||
} else {
|
||||
TechDraw::AOE* aoe = static_cast<TechDraw::AOE*> (base);
|
||||
double r1 = aoe->minor;
|
||||
double r2 = aoe->major;
|
||||
@@ -359,7 +359,7 @@ App::DocumentObjectExecReturn *DrawViewDimension::execute(void)
|
||||
arcPoints pts;
|
||||
pts.center = Base::Vector3d(0.0,0.0,0.0);
|
||||
pts.radius = 0.0;
|
||||
if ((base && base->geomType == TechDraw::GeomType::CIRCLE) ||
|
||||
if ((base && base->geomType == TechDraw::GeomType::CIRCLE) ||
|
||||
(base && base->geomType == TechDraw::GeomType::ARCOFCIRCLE)) {
|
||||
circle = static_cast<TechDraw::Circle*> (base);
|
||||
pts.center = Base::Vector3d(circle->center.x,circle->center.y,0.0);
|
||||
@@ -491,7 +491,7 @@ App::DocumentObjectExecReturn *DrawViewDimension::execute(void)
|
||||
int idx0 = DrawUtil::getIndexFromName(subElements[0]);
|
||||
int idx1 = DrawUtil::getIndexFromName(subElements[1]);
|
||||
int idx2 = DrawUtil::getIndexFromName(subElements[2]);
|
||||
|
||||
|
||||
TechDraw::Vertex* vert0 = getViewPart()->getProjVertexByIndex(idx0);
|
||||
TechDraw::Vertex* vert1 = getViewPart()->getProjVertexByIndex(idx1);
|
||||
TechDraw::Vertex* vert2 = getViewPart()->getProjVertexByIndex(idx2);
|
||||
@@ -590,7 +590,7 @@ std::string DrawViewDimension::getFormatedValue(int partial)
|
||||
}
|
||||
|
||||
//find the %x.y tag in FormatSpec
|
||||
QRegExp rxFormat(QString::fromUtf8("%[0-9]*\\.*[0-9]*[aefgAEFG]")); //printf double format spec
|
||||
QRegExp rxFormat(QString::fromUtf8("%[0-9]*\\.*[0-9]*[aefgAEFG]")); //printf double format spec
|
||||
QString match;
|
||||
// QString specVal = userVal; //sensible default
|
||||
specVal = userVal; //sensible default
|
||||
@@ -726,7 +726,7 @@ double DrawViewDimension::getDimValue()
|
||||
} else if(Type.isValue("Radius")){
|
||||
arcPoints pts = m_arcPoints;
|
||||
result = pts.radius / getViewPart()->getScale(); //Projected BaseGeom is scaled for drawing
|
||||
|
||||
|
||||
} else if(Type.isValue("Diameter")){
|
||||
arcPoints pts = m_arcPoints;
|
||||
result = (pts.radius * 2.0) / getViewPart()->getScale(); //Projected BaseGeom is scaled for drawing
|
||||
@@ -820,7 +820,7 @@ pointPair DrawViewDimension::getPointsTwoVerts()
|
||||
result.first = v0->pnt;
|
||||
result.second = v1->pnt;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
pointPair DrawViewDimension::getPointsEdgeVert()
|
||||
{
|
||||
@@ -907,7 +907,7 @@ int DrawViewDimension::getRefType3(const std::string g1,
|
||||
{
|
||||
int refType = invalidRef;
|
||||
if ((DrawUtil::getGeomTypeFromName(g1) == "Vertex") &&
|
||||
(DrawUtil::getGeomTypeFromName(g2) == "Vertex") &&
|
||||
(DrawUtil::getGeomTypeFromName(g2) == "Vertex") &&
|
||||
(DrawUtil::getGeomTypeFromName(g3) == "Vertex") ) {
|
||||
refType = threeVertex;
|
||||
}
|
||||
@@ -926,7 +926,7 @@ bool DrawViewDimension::checkReferences2D() const
|
||||
const std::vector<std::string> &subElements = References2D.getSubValues();
|
||||
if (!subElements.empty()) {
|
||||
for (auto& s: subElements) {
|
||||
if (!s.empty()) {
|
||||
if (!s.empty()) {
|
||||
int idx = DrawUtil::getIndexFromName(s);
|
||||
if (DrawUtil::getGeomTypeFromName(s) == "Edge") {
|
||||
TechDraw::BaseGeom* geom = getViewPart()->getGeomByIndex(idx);
|
||||
@@ -995,7 +995,7 @@ void DrawViewDimension::clear3DMeasurements()
|
||||
measurement->clear();
|
||||
}
|
||||
|
||||
void DrawViewDimension::dumpRefs2D(char* text) const
|
||||
void DrawViewDimension::dumpRefs2D(const char* text) const
|
||||
{
|
||||
Base::Console().Message("DUMP - %s\n",text);
|
||||
const std::vector<App::DocumentObject*> &objects = References2D.getValues();
|
||||
@@ -1165,20 +1165,20 @@ std::string DrawViewDimension::getDefaultFormatSpec() const
|
||||
QString formatPrecision = QString::number(precision);
|
||||
|
||||
std::string prefix = getPrefix();
|
||||
|
||||
|
||||
if (!prefix.empty()) {
|
||||
qPrefix = QString::fromUtf8(prefix.data(),prefix.size());
|
||||
}
|
||||
|
||||
formatSpec = qPrefix + format1 + formatPrecision + format2;
|
||||
} else {
|
||||
|
||||
|
||||
std::string prefix = getPrefix();
|
||||
qPrefix = QString::fromUtf8(prefix.data(),prefix.size());
|
||||
formatSpec = qPrefix + QString::fromStdString(prefFormat);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return Base::Tools::toStdString(formatSpec);
|
||||
}
|
||||
|
||||
@@ -1192,7 +1192,7 @@ bool DrawViewDimension::references(std::string refName) const
|
||||
const std::vector<std::string> &subElements = References2D.getSubValues();
|
||||
if (!subElements.empty()) {
|
||||
for (auto& s: subElements) {
|
||||
if (!s.empty()) {
|
||||
if (!s.empty()) {
|
||||
if (s == refName) {
|
||||
result = true;
|
||||
break;
|
||||
|
||||
@@ -166,7 +166,7 @@ protected:
|
||||
private:
|
||||
static const char* TypeEnums[];
|
||||
static const char* MeasureTypeEnums[];
|
||||
void dumpRefs2D(char* text) const;
|
||||
void dumpRefs2D(const char* text) const;
|
||||
//Dimension "geometry"
|
||||
pointPair m_linearPoints;
|
||||
arcPoints m_arcPoints;
|
||||
|
||||
@@ -220,8 +220,8 @@ public:
|
||||
TechDraw::GeomFormat* getGeomFormatByGeom(int idx) const;
|
||||
void clearGeomFormats(void);
|
||||
|
||||
void dumpVerts(std::string text);
|
||||
void dumpCosVerts(std::string text);
|
||||
void dumpVerts(const std::string text);
|
||||
void dumpCosVerts(const std::string text);
|
||||
|
||||
protected:
|
||||
TechDraw::GeometryObject *geometryObject;
|
||||
|
||||
@@ -1460,7 +1460,7 @@ std::string Vertex::getTagAsString(void) const
|
||||
// throw Base::TypeError("Vertex tag can not be assigned as types do not match.");
|
||||
//}
|
||||
|
||||
void Vertex::dump(char* title)
|
||||
void Vertex::dump(const char* title)
|
||||
{
|
||||
Base::Console().Message("TD::Vertex - %s - point: %s vis: %d cosmetic: %d cosLink: %d cosTag: %s\n",
|
||||
title, DrawUtil::formatVector(pnt).c_str(), hlrVisible, cosmetic, cosmeticLink,
|
||||
|
||||
@@ -301,7 +301,7 @@ class TechDrawExport Vertex
|
||||
|
||||
virtual void Save(Base::Writer &/*writer*/) const;
|
||||
virtual void Restore(Base::XMLReader &/*reader*/);
|
||||
virtual void dump(char* title = "");
|
||||
virtual void dump(const char* title = "");
|
||||
|
||||
Base::Vector3d pnt;
|
||||
ExtractionType extractType; //obs?
|
||||
|
||||
@@ -284,7 +284,7 @@ std::vector<double> PATLineSpec::split(std::string line)
|
||||
return result;
|
||||
}
|
||||
|
||||
void PATLineSpec::dump(char* title)
|
||||
void PATLineSpec::dump(const char* title)
|
||||
{
|
||||
Base::Console().Message( "DUMP: %s\n",title);
|
||||
Base::Console().Message( "Angle: %.3f\n", m_angle);
|
||||
@@ -475,7 +475,7 @@ DashSpec DashSpec::reversed(void)
|
||||
return result;
|
||||
}
|
||||
|
||||
void DashSpec::dump(char* title)
|
||||
void DashSpec::dump(const char* title)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << title << ": " ;
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
bool empty(void) {return m_parms.empty();}
|
||||
int size(void) {return m_parms.size();}
|
||||
double length(void);
|
||||
void dump(char* title);
|
||||
void dump(const char* title);
|
||||
DashSpec reversed(void);
|
||||
|
||||
private:
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
|
||||
bool isDashed(void);
|
||||
|
||||
void dump(char* title);
|
||||
void dump(const char* title);
|
||||
|
||||
private:
|
||||
void init(void);
|
||||
|
||||
@@ -89,7 +89,7 @@ void LineGroup::setWeight(std::string s, double weight)
|
||||
}
|
||||
}
|
||||
|
||||
void LineGroup::dump(char* title)
|
||||
void LineGroup::dump(const char* title)
|
||||
{
|
||||
Base::Console().Message( "DUMP: %s\n",title);
|
||||
Base::Console().Message( "Name: %s\n", m_name.c_str());
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
double getWeight(std::string s);
|
||||
void setWeight(std::string s, double weight);
|
||||
// void setWeight(const char* s, double weight);
|
||||
void dump(char* title);
|
||||
void dump(const char* title);
|
||||
std::string getName(void) { return m_name; }
|
||||
void setName(std::string s) { m_name = s; }
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ void QGEPath::startPathEdit()
|
||||
inEdit(true);
|
||||
m_saveDeltas = m_deltas;
|
||||
showMarkers(m_deltas);
|
||||
}
|
||||
}
|
||||
|
||||
void QGEPath::restoreState()
|
||||
{
|
||||
@@ -262,7 +262,7 @@ void QGEPath::restoreState()
|
||||
}
|
||||
m_deltas = m_saveDeltas;
|
||||
updatePath();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void QGEPath::showMarkers(std::vector<QPointF> deltas)
|
||||
@@ -278,7 +278,7 @@ void QGEPath::showMarkers(std::vector<QPointF> deltas)
|
||||
}
|
||||
|
||||
clearMarkers();
|
||||
|
||||
|
||||
int pointDx = 0;
|
||||
for (auto& p: deltas) {
|
||||
QGMarker* v = new QGMarker(pointDx);
|
||||
@@ -308,10 +308,10 @@ void QGEPath::showMarkers(std::vector<QPointF> deltas)
|
||||
v->setZValue(ZVALUE::VERTEX);
|
||||
v->setPos(p * m_scale);
|
||||
v->show();
|
||||
|
||||
|
||||
m_markers.push_back(v);
|
||||
pointDx++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void QGEPath::clearMarkers()
|
||||
@@ -373,7 +373,7 @@ void QGEPath::onEndEdit(void)
|
||||
inEdit(false);
|
||||
updatePath();
|
||||
updateFeature(); //Q_EMIT pointsUpdated(m_deltas) ==> onLineEditComplete <<<1
|
||||
clearMarkers();
|
||||
clearMarkers();
|
||||
}
|
||||
|
||||
//updates the painterpath using our deltas
|
||||
@@ -504,7 +504,7 @@ void QGEPath::paint ( QPainter * painter, const QStyleOptionGraphicsItem * optio
|
||||
QGIPrimPath::paint (painter, &myOption, widget);
|
||||
}
|
||||
|
||||
void QGEPath::addPoint(unsigned int before, unsigned int after)
|
||||
void QGEPath::addPoint(unsigned int before, unsigned int after)
|
||||
{
|
||||
std::vector<QPointF> deltaCopy = getDeltas();
|
||||
unsigned int iMax = deltaCopy.size() - 1;
|
||||
@@ -533,34 +533,34 @@ void QGEPath::deletePoint(unsigned int atX)
|
||||
setDeltas(deltaCopy);
|
||||
}
|
||||
|
||||
void QGEPath::dumpDeltas(char* text)
|
||||
void QGEPath::dumpDeltas(const char* text)
|
||||
{
|
||||
int idb = 0;
|
||||
for (auto& d: m_deltas) {
|
||||
Base::Console().Message("QGEP - %s - delta: %d %s\n", text,
|
||||
idb,TechDraw::DrawUtil::formatVector(d).c_str());
|
||||
idb++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void QGEPath::dumpPoints(char* text)
|
||||
void QGEPath::dumpPoints(const char* text)
|
||||
{
|
||||
int idb = 0;
|
||||
for (auto& d: m_points) {
|
||||
Base::Console().Message("QGEP - %s - point: %d %s\n", text,
|
||||
idb,TechDraw::DrawUtil::formatVector(d).c_str());
|
||||
idb++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void QGEPath::dumpMarkerPos(char* text)
|
||||
void QGEPath::dumpMarkerPos(const char* text)
|
||||
{
|
||||
int idb = 0;
|
||||
for (auto& m: m_markers) {
|
||||
Base::Console().Message("QGEP - %s - markerPos: %d %s\n", text,
|
||||
idb,TechDraw::DrawUtil::formatVector(m->pos()).c_str());
|
||||
idb++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include <Mod/TechDraw/Gui/moc_QGEPath.cpp>
|
||||
|
||||
@@ -118,9 +118,9 @@ public:
|
||||
void updateFeature();
|
||||
void drawGhost(void);
|
||||
|
||||
void dumpDeltas(char* text);
|
||||
void dumpPoints(char* text);
|
||||
void dumpMarkerPos(char* text);
|
||||
void dumpDeltas(const char* text);
|
||||
void dumpPoints(const char* text);
|
||||
void dumpMarkerPos(const char* text);
|
||||
void restoreState(void);
|
||||
void setStartAdjust(double adjust);
|
||||
void setEndAdjust(double adjust);
|
||||
|
||||
@@ -709,7 +709,7 @@ int QGIView::calculateFontPixelWidth(const QFont &font)
|
||||
|
||||
const double QGIView::DefaultFontSizeInMM = 5.0;
|
||||
|
||||
void QGIView::dumpRect(char* text, QRectF r) {
|
||||
void QGIView::dumpRect(const char* text, QRectF r) {
|
||||
Base::Console().Message("DUMP - %s - rect: (%.3f,%.3f) x (%.3f,%.3f)\n",text,
|
||||
r.left(),r.top(),r.right(),r.bottom());
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ protected:
|
||||
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override;
|
||||
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override;
|
||||
virtual QRectF customChildrenBoundingRect(void) const;
|
||||
void dumpRect(char* text, QRectF r);
|
||||
void dumpRect(const char* text, QRectF r);
|
||||
|
||||
QString getPrefFont(void);
|
||||
double getPrefFontSize(void);
|
||||
|
||||
Reference in New Issue
Block a user