Login  Register

Re: Customize shortcut/hotkeys

Posted by ACL on May 20, 2020; 11:37am
URL: https://forum.librecad.org/Customize-shortcut-hotkeys-tp5718912p5718922.html

I'm getting lost in all of the source code but let me add a bit more. It seems that the commands are listed in the qg_actionhandler.cpp file. The circle-related ones are:

rs_actiondrawcircle  * circle, ci
rs_actiondrawcircle2p   * circle2, c2
lc_actiondrawcircle2pr
rs_actiondrawcircle3p   * circle3, c3
rs_actiondrawcircletan1_2p
rs_actiondrawcircletan2_1p
rs_actiondrawcirclecr   * circlecr, cc
rs_actiondrawcircleinscribe
rs_actiondrawcircletan2
rs_actiondrawcircletan3   * tan3, ct3

Only the commands with existing aliases (with stars and aliases, above) are in the file I mentioned previously, so on the other five, maybe we have no immediate way to access them with an alias because there isn't already an alias. What is listed as the "command-untranslated" in the alias file is really just an alias anyway?

There is also a file rs_circle.cpp which has subroutines for different circle types. I think the one you want is this one but I don't know the link between the commands above and this function. Maybe it is called by rs_actiondrawcircletan2?


/**
  * create a circle of radius r and tangential to two given entities
  */
RS_VectorSolutions RS_Circle::createTan2(const std::vector<RS_AtomicEntity*>& circles, const double& r)
{
    if(circles.size()<2) return false;
        auto e0=circles[0]->offsetTwoSides(r);
        auto e1=circles[1]->offsetTwoSides(r);
    RS_VectorSolutions centers;
        if(e0.size() && e1.size()) {
        for(auto it0=e0.begin();it0!=e0.end();it0++){
            for(auto it1=e1.begin();it1!=e1.end();it1++){
                centers.push_back(RS_Information::getIntersection(*it0,*it1));
            }
        }
    }
    for(auto it0=e0.begin();it0!=e0.end();it0++){
        delete *it0;
    }
    for(auto it0=e1.begin();it0!=e1.end();it0++){
        delete *it0;
        }
    return centers;

}