Console: rename PascalCase named methods to camelCase

This commit is contained in:
bofdahof
2025-03-30 00:50:27 +10:00
committed by Kacper Donat
parent 1dbc0638c3
commit ba2c2ca5ad
497 changed files with 2423 additions and 2425 deletions

View File

@@ -92,7 +92,7 @@ DrawProjGroup::DrawProjGroup()
//TODO: this duplicates code in DVP
std::vector<App::DocumentObject*> DrawProjGroup::getAllSources() const
{
// Base::Console().Message("DPG::getAllSources()\n");
// Base::Console().message("DPG::getAllSources()\n");
const std::vector<App::DocumentObject*> links = Source.getValues();
std::vector<DocumentObject*> xLinks;
XSource.getLinks(xLinks);
@@ -169,7 +169,7 @@ void DrawProjGroup::onChanged(const App::Property* prop)
App::DocumentObjectExecReturn* DrawProjGroup::execute()
{
// Base::Console().Message("DPG::execute() - %s - waitingForChildren: %d\n",
// Base::Console().message("DPG::execute() - %s - waitingForChildren: %d\n",
// getNameInDocument(), waitingForChildren());
if (!keepUpdated())
return App::DocumentObject::StdReturn;
@@ -227,7 +227,7 @@ short DrawProjGroup::mustExecute() const
void DrawProjGroup::reportReady()
{
// Base::Console().Message("DPG::reportReady - waitingForChildren: %d\n", waitingForChildren());
// Base::Console().message("DPG::reportReady - waitingForChildren: %d\n", waitingForChildren());
if (waitingForChildren()) {
//not ready yet
return;
@@ -255,7 +255,7 @@ TechDraw::DrawPage* DrawProjGroup::getPage() const { return findParentPage(); }
//does the unscaled DPG fit on the page?
bool DrawProjGroup::checkFit() const
{
// Base::Console().Message("DPG::checkFit() - %s\n", getNameInDocument());
// Base::Console().message("DPG::checkFit() - %s\n", getNameInDocument());
if (waitingForChildren()) {
//assume everything fits since we don't know what size the children are
return true;
@@ -268,7 +268,7 @@ bool DrawProjGroup::checkFit() const
bool DrawProjGroup::checkFit(DrawPage* page) const
{
// Base::Console().Message("DPG::checkFit(page) - %s\n", getNameInDocument());
// Base::Console().message("DPG::checkFit(page) - %s\n", getNameInDocument());
if (waitingForChildren()) {
return true;
}
@@ -283,7 +283,7 @@ bool DrawProjGroup::checkFit(DrawPage* page) const
//calculate a scale that fits all views on page
double DrawProjGroup::autoScale() const
{
// Base::Console().Message("DPG::autoScale() - %s\n", getNameInDocument());
// Base::Console().message("DPG::autoScale() - %s\n", getNameInDocument());
auto page = findParentPage();
if (!page) {
throw Base::RuntimeError("No page is assigned to this feature");
@@ -293,7 +293,7 @@ double DrawProjGroup::autoScale() const
double DrawProjGroup::autoScale(double w, double h) const
{
// Base::Console().Message("DPG::autoScale(%.3f, %.3f) - %s\n", w, h, getNameInDocument());
// Base::Console().message("DPG::autoScale(%.3f, %.3f) - %s\n", w, h, getNameInDocument());
//get the space used by views + white space at 1:1 scale
QRectF bigBox = getRect(false);//unscaled box
@@ -309,7 +309,7 @@ QRectF DrawProjGroup::getRect() const { return getRect(true); }
QRectF DrawProjGroup::getRect(bool scaled) const
{
// Base::Console().Message("DPG::getRect - views: %d\n", Views.getValues().size());
// Base::Console().message("DPG::getRect - views: %d\n", Views.getValues().size());
std::array<DrawProjGroupItem*, MAXPROJECTIONCOUNT> viewPtrs;
arrangeViewPointers(viewPtrs);
double totalWidth, totalHeight;
@@ -359,7 +359,7 @@ App::DocumentObject* DrawProjGroup::getProjObj(const char* viewProjType) const
auto projPtr(freecad_cast<DrawProjGroupItem*>(it));
if (!projPtr) {
//if an element in Views is not a DPGI, something really bad has happened somewhere
Base::Console().Error("PROBLEM - DPG::getProjObj - non DPGI entry in Views! %s / %s\n",
Base::Console().error("PROBLEM - DPG::getProjObj - non DPGI entry in Views! %s / %s\n",
getNameInDocument(), viewProjType);
throw Base::TypeError("Error: projection in DPG list is not a DPGI!");
}
@@ -377,7 +377,7 @@ DrawProjGroupItem* DrawProjGroup::getProjItem(const char* viewProjType) const
auto result(dynamic_cast<TechDraw::DrawProjGroupItem*>(docObj));
if (!result && docObj) {
//should never have a item in DPG that is not a DPGI.
Base::Console().Error("PROBLEM - DPG::getProjItem finds non-DPGI in Group %s / %s\n",
Base::Console().error("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!");
}
@@ -409,7 +409,7 @@ bool DrawProjGroup::hasProjection(const char* viewProjType) const
auto view(dynamic_cast<TechDraw::DrawProjGroupItem*>(it));
if (!view) {
//should never have a item in DPG that is not a DPGI.
Base::Console().Error("PROBLEM - DPG::hasProjection finds non-DPGI in Group %s / %s\n",
Base::Console().error("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!");
}
@@ -423,12 +423,12 @@ bool DrawProjGroup::hasProjection(const char* viewProjType) const
bool DrawProjGroup::canDelete(const char* viewProjType) const
{
// Base::Console().Message("DPG::canDelete(%s)\n", viewProjType);
// Base::Console().message("DPG::canDelete(%s)\n", viewProjType);
for (const auto it : Views.getValues()) {
auto view(dynamic_cast<TechDraw::DrawProjGroupItem*>(it));
if (!view) {
//should never have a item in DPG that is not a DPGI.
Base::Console().Error("PROBLEM - DPG::hasProjection finds non-DPGI in Group %s / %s\n",
Base::Console().error("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!");
}
@@ -453,13 +453,13 @@ bool DrawProjGroup::canDelete(const char* viewProjType) const
App::DocumentObject* DrawProjGroup::addProjection(const char* viewProjType)
{
// Base::Console().Message("DPG::addProjection(%s)\n", viewProjType ? viewProjType : "null");
// Base::Console().message("DPG::addProjection(%s)\n", viewProjType ? viewProjType : "null");
DrawProjGroupItem* view(nullptr);
std::pair<Base::Vector3d, Base::Vector3d> vecs;
DrawPage* dp = findParentPage();
if (!dp)
Base::Console().Error("DPG:addProjection - %s - DPG is not on a page!\n",
Base::Console().error("DPG:addProjection - %s - DPG is not on a page!\n",
getNameInDocument());
if (checkViewProjType(viewProjType) && !hasProjection(viewProjType)) {
@@ -467,7 +467,7 @@ App::DocumentObject* DrawProjGroup::addProjection(const char* viewProjType)
view = getDocument()->addObject<TechDraw::DrawProjGroupItem>(FeatName.c_str());
if (!view) {
//should never happen that we create a DPGI that isn't a DPGI!!
Base::Console().Error("PROBLEM - DPG::addProjection - created a non DPGI! %s / %s\n",
Base::Console().error("PROBLEM - DPG::addProjection - created a non DPGI! %s / %s\n",
getNameInDocument(), viewProjType);
throw Base::TypeError("Error: new projection is not a DPGI!");
}
@@ -523,7 +523,7 @@ int DrawProjGroup::removeProjection(const char* viewProjType)
}
else {
//if an element in Views is not a DPGI, something really bad has happened somewhere
Base::Console().Error(
Base::Console().error(
"PROBLEM - DPG::removeProjection - tries to remove non DPGI! %s / %s\n",
getNameInDocument(), viewProjType);
throw Base::TypeError("Error: projection in DPG list is not a DPGI!");
@@ -547,7 +547,7 @@ int DrawProjGroup::purgeProjections()
}
else {
//if an element in Views is not a DPGI, something really bad has happened somewhere
Base::Console().Error("PROBLEM - DPG::purgeProjection - tries to remove non DPGI! %s\n",
Base::Console().error("PROBLEM - DPG::purgeProjection - tries to remove non DPGI! %s\n",
getNameInDocument());
throw Base::TypeError("Error: projection in DPG list is not a DPGI!");
}
@@ -568,13 +568,13 @@ std::pair<Base::Vector3d, Base::Vector3d> DrawProjGroup::getDirsFromFront(DrawPr
std::pair<Base::Vector3d, Base::Vector3d> DrawProjGroup::getDirsFromFront(ProjDirection viewType)
{
// Base::Console().Message("DPG::getDirsFromFront(%s)\n", viewType.c_str());
// Base::Console().message("DPG::getDirsFromFront(%s)\n", viewType.c_str());
std::pair<Base::Vector3d, Base::Vector3d> result;
Base::Vector3d projDir, rotVec;
DrawProjGroupItem* anch = getAnchor();
if (!anch) {
Base::Console().Warning("DPG::getDirsFromFront - %s - No Anchor!\n", Label.getValue());
Base::Console().warning("DPG::getDirsFromFront - %s - No Anchor!\n", Label.getValue());
throw Base::RuntimeError("Project Group missing Anchor projection item");
}
@@ -594,7 +594,7 @@ gp_Dir DrawProjGroup::vec2dir(Base::Vector3d v)
//this can be improved. this implementation positions views too far apart.
Base::Vector3d DrawProjGroup::getXYPosition(const char* viewTypeCStr)
{
// Base::Console().Message("DPG::getXYPosition(%s)\n", Label.getValue());
// Base::Console().message("DPG::getXYPosition(%s)\n", Label.getValue());
// Third Angle: FTL T FTRight 0 1 2
// L F Right Rear 3 4 5 6
// FBL B FBRight 7 8 9
@@ -761,7 +761,7 @@ int DrawProjGroup::getViewIndex(const char* viewTypeCStr) const
projType = dp->ProjectionType.getValueAsString();
}
else {
Base::Console().Warning(
Base::Console().warning(
"DPG: %s - can not find parent page. Using default Projection Type. (1)\n",
getNameInDocument());
int projConv = getDefProjConv();
@@ -835,9 +835,9 @@ void DrawProjGroup::arrangeViewPointers(
projType = dp->ProjectionType.getValueAsString();
}
else {
Base::Console().Error("DPG:arrangeViewPointers - %s - DPG is not on a page!\n",
Base::Console().error("DPG:arrangeViewPointers - %s - DPG is not on a page!\n",
getNameInDocument());
Base::Console().Warning(
Base::Console().warning(
"DPG:arrangeViewPointers - using system default Projection Type\n",
getNameInDocument());
int projConv = getDefProjConv();
@@ -850,7 +850,7 @@ void DrawProjGroup::arrangeViewPointers(
// Iterate through views and populate viewPtrs
if (strcmp(projType, "Third Angle") != 0 && strcmp(projType, "First Angle") != 0) {
Base::Console().Warning("DPG: %s - unknown Projection convention: %s\n",
Base::Console().warning("DPG: %s - unknown Projection convention: %s\n",
getNameInDocument(), projType);
throw Base::ValueError(
"Unknown Projection convention in DrawProjGroup::arrangeViewPointers");
@@ -869,7 +869,7 @@ void DrawProjGroup::arrangeViewPointers(
auto oView(freecad_cast<DrawProjGroupItem*>(it));
if (!oView) {
//if an element in Views is not a DPGI, something really bad has happened somewhere
Base::Console().Error(
Base::Console().error(
"PROBLEM - DPG::arrangeViewPointers - non DPGI in Views! %s\n",
getNameInDocument());
throw Base::TypeError("Error: projection in DPG list is not a DPGI!");
@@ -908,7 +908,7 @@ void DrawProjGroup::arrangeViewPointers(
viewPtrs[thirdAngle ? 9 : 0] = oView;
}
else {
Base::Console().Warning("DPG: %s - unknown view type: %s. \n",
Base::Console().warning("DPG: %s - unknown view type: %s. \n",
getNameInDocument(), viewTypeCStr);
throw Base::TypeError(
"Unknown view type in DrawProjGroup::arrangeViewPointers.");
@@ -942,7 +942,7 @@ void DrawProjGroup::makeViewBbs(std::array<DrawProjGroupItem*, MAXPROJECTIONCOUN
void DrawProjGroup::recomputeChildren()
{
// Base::Console().Message("DPG::recomputeChildren() - waiting: %d\n", waitingForChildren());
// Base::Console().message("DPG::recomputeChildren() - waiting: %d\n", waitingForChildren());
for (const auto it : Views.getValues()) {
auto view(freecad_cast<DrawProjGroupItem*>(it));
if (!view) {
@@ -956,7 +956,7 @@ void DrawProjGroup::recomputeChildren()
void DrawProjGroup::autoPositionChildren()
{
// Base::Console().Message("DPG::autoPositionChildren() - %s - waiting: %d\n",
// Base::Console().message("DPG::autoPositionChildren() - %s - waiting: %d\n",
// getNameInDocument(), waitingForChildren());
for (const auto it : Views.getValues()) {
auto view(freecad_cast<DrawProjGroupItem*>(it));
@@ -975,7 +975,7 @@ void DrawProjGroup::autoPositionChildren()
*/
void DrawProjGroup::updateChildrenScale()
{
// Base::Console().Message("DPG::updateChildrenScale() - waiting: %d\n", waitingForChildren());
// Base::Console().message("DPG::updateChildrenScale() - waiting: %d\n", waitingForChildren());
for (const auto it : Views.getValues()) {
auto view(freecad_cast<DrawProjGroupItem*>(it));
if (!view) {
@@ -998,7 +998,7 @@ void DrawProjGroup::updateChildrenSource()
auto view(freecad_cast<DrawProjGroupItem*>(it));
if (!view) {
//if an element in Views is not a DPGI, something really bad has happened somewhere
Base::Console().Error(
Base::Console().error(
"PROBLEM - DPG::updateChildrenSource - non DPGI entry in Views! %s\n",
getNameInDocument());
throw Base::TypeError("Error: projection in DPG list is not a DPGI!");
@@ -1022,7 +1022,7 @@ void DrawProjGroup::updateChildrenLock()
auto view(freecad_cast<DrawProjGroupItem*>(it));
if (!view) {
//if an element in Views is not a DPGI, something really bad has happened somewhere
Base::Console().Error(
Base::Console().error(
"PROBLEM - DPG::updateChildrenLock - non DPGI entry in Views! %s\n",
getNameInDocument());
throw Base::TypeError("Error: projection in DPG list is not a DPGI!");
@@ -1037,7 +1037,7 @@ void DrawProjGroup::updateChildrenEnforce(void)
auto view(freecad_cast<DrawProjGroupItem*>(it));
if (!view) {
//if an element in Views is not a DPGI, something really bad has happened somewhere
Base::Console().Error(
Base::Console().error(
"PROBLEM - DPG::updateChildrenEnforce - non DPGI entry in Views! %s\n",
getNameInDocument());
throw Base::TypeError("Error: projection in DPG list is not a DPGI!");
@@ -1183,7 +1183,7 @@ int DrawProjGroup::getDefProjConv() const { return Preferences::projectionAngle(
*/
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;
@@ -1192,7 +1192,7 @@ void DrawProjGroup::dumpISO(const char* title)
dir = v->Direction.getValue();
axis = v->getXDirection();
Base::Console().Message("%s: %s/%s\n", t.c_str(), DrawUtil::formatVector(dir).c_str(),
Base::Console().message("%s: %s/%s\n", t.c_str(), DrawUtil::formatVector(dir).c_str(),
DrawUtil::formatVector(axis).c_str());
}
}