Change Face centerline command name and icon
This commit is contained in:
@@ -587,21 +587,21 @@ bool CmdTechDrawAnnotation::isActive(void)
|
||||
// TechDraw_Centerline
|
||||
//===========================================================================
|
||||
|
||||
DEF_STD_CMD_A(CmdTechDrawCenterLine);
|
||||
DEF_STD_CMD_A(CmdTechDrawFaceCenterLine);
|
||||
|
||||
CmdTechDrawCenterLine::CmdTechDrawCenterLine()
|
||||
: Command("TechDraw_CenterLine")
|
||||
CmdTechDrawFaceCenterLine::CmdTechDrawFaceCenterLine()
|
||||
: Command("TechDraw_FaceCenterLine")
|
||||
{
|
||||
sAppModule = "TechDraw";
|
||||
sGroup = QT_TR_NOOP("TechDraw");
|
||||
sMenuText = QT_TR_NOOP("Add a centerline to a Face(s)");
|
||||
sToolTipText = QT_TR_NOOP("Add a centerline to a Face(s)");
|
||||
sWhatsThis = "TechDraw_CenterLine";
|
||||
sWhatsThis = "TechDraw_FaceCenterLine";
|
||||
sStatusTip = sToolTipText;
|
||||
sPixmap = "actions/techdraw-centerline";
|
||||
sPixmap = "actions/techdraw-facecenterline";
|
||||
}
|
||||
|
||||
void CmdTechDrawCenterLine::activated(int iMsg)
|
||||
void CmdTechDrawFaceCenterLine::activated(int iMsg)
|
||||
{
|
||||
Q_UNUSED(iMsg);
|
||||
|
||||
@@ -652,7 +652,7 @@ void CmdTechDrawCenterLine::activated(int iMsg)
|
||||
SubNames));
|
||||
}
|
||||
|
||||
bool CmdTechDrawCenterLine::isActive(void)
|
||||
bool CmdTechDrawFaceCenterLine::isActive(void)
|
||||
{
|
||||
bool havePage = DrawGuiUtil::needPage(this);
|
||||
bool haveView = DrawGuiUtil::needView(this, false);
|
||||
@@ -762,7 +762,7 @@ void CreateTechDrawCommandsAnnotate(void)
|
||||
rcCmdMgr.addCommand(new CmdTechDrawMidpoints());
|
||||
rcCmdMgr.addCommand(new CmdTechDrawQuadrant());
|
||||
rcCmdMgr.addCommand(new CmdTechDrawAnnotation());
|
||||
rcCmdMgr.addCommand(new CmdTechDrawCenterLine());
|
||||
rcCmdMgr.addCommand(new CmdTechDrawFaceCenterLine());
|
||||
rcCmdMgr.addCommand(new CmdTechDrawCosmeticEraser());
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
<file>icons/actions/techdraw-point.svg</file>
|
||||
<file>icons/actions/techdraw-midpoint.svg</file>
|
||||
<file>icons/actions/techdraw-quadrant.svg</file>
|
||||
<file>icons/actions/techdraw-centerline.svg</file>
|
||||
<file>icons/actions/techdraw-facecenterline.svg</file>
|
||||
<file>icons/actions/techdraw-eraser.svg</file>
|
||||
<file>icons/actions/section-up.svg</file>
|
||||
<file>icons/actions/section-down.svg</file>
|
||||
@@ -145,4 +145,4 @@
|
||||
<file>translations/TechDraw_ar.qm</file>
|
||||
<file>translations/TechDraw_vi.qm</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
</RCC>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
width="64"
|
||||
height="64"
|
||||
id="svg3085"
|
||||
sodipodi:docname="techdraw-centerline.svg"
|
||||
sodipodi:docname="techdraw-facecenterline.svg"
|
||||
inkscape:version="0.92.4 (unknown)">
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
@@ -29,9 +29,9 @@
|
||||
inkscape:window-height="703"
|
||||
id="namedview983"
|
||||
showgrid="true"
|
||||
inkscape:zoom="8.03125"
|
||||
inkscape:cx="31.875486"
|
||||
inkscape:cy="34.392085"
|
||||
inkscape:zoom="5.6789513"
|
||||
inkscape:cx="34.789479"
|
||||
inkscape:cy="32"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="26"
|
||||
inkscape:window-maximized="1"
|
||||
@@ -39,10 +39,25 @@
|
||||
inkscape:snap-global="true">
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid985" />
|
||||
id="grid985"
|
||||
empspacing="2"
|
||||
color="#ff423f"
|
||||
opacity="0.1254902" />
|
||||
</sodipodi:namedview>
|
||||
<defs
|
||||
id="defs3087">
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient1043-3">
|
||||
<stop
|
||||
style="stop-color:#729fcf;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop1039" />
|
||||
<stop
|
||||
style="stop-color:#729fcf;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop1041" />
|
||||
</linearGradient>
|
||||
<marker
|
||||
inkscape:stockid="TriangleOutM"
|
||||
orient="auto"
|
||||
@@ -171,7 +186,7 @@
|
||||
</marker>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient5062">
|
||||
id="linearGradient5062-3">
|
||||
<stop
|
||||
style="stop-color:#729fcf;stop-opacity:1"
|
||||
offset="0"
|
||||
@@ -249,17 +264,17 @@
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5062"
|
||||
xlink:href="#linearGradient5062-3"
|
||||
id="linearGradient5064"
|
||||
x1="33.055637"
|
||||
y1="43.596096"
|
||||
x2="42.195377"
|
||||
y2="57.417107"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="rotate(-18.319839,46.412112,31.514115)" />
|
||||
gradientTransform="rotate(-18.319839,64.341466,-116.09907)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5062"
|
||||
xlink:href="#linearGradient5062-3"
|
||||
id="linearGradient5088"
|
||||
x1="43.818283"
|
||||
y1="11.684036"
|
||||
@@ -268,14 +283,33 @@
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5062"
|
||||
xlink:href="#linearGradient5062-3"
|
||||
id="linearGradient1029"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="43.818283"
|
||||
y1="11.684036"
|
||||
x2="59.806271"
|
||||
y2="11.684036"
|
||||
gradientTransform="rotate(-18.319839,57.204921,33.675315)" />
|
||||
gradientTransform="rotate(-18.319839,75.134275,-113.93787)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5062-3"
|
||||
id="linearGradient1242"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="rotate(-18.319839,64.341466,-116.09907)"
|
||||
x1="33.055637"
|
||||
y1="43.596096"
|
||||
x2="42.195377"
|
||||
y2="57.417107" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient1043-3"
|
||||
id="linearGradient1045"
|
||||
x1="46"
|
||||
y1="-42"
|
||||
x2="22"
|
||||
y2="-18"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
</defs>
|
||||
<metadata
|
||||
id="metadata3090">
|
||||
@@ -307,43 +341,117 @@
|
||||
id="rect2535"
|
||||
width="52"
|
||||
height="15"
|
||||
x="6"
|
||||
y="24.5" />
|
||||
x="60"
|
||||
y="74" />
|
||||
<g
|
||||
id="g1050"
|
||||
transform="translate(-12.867793,-1.924182)">
|
||||
id="g1246"
|
||||
transform="translate(0.3521777,68.322473)">
|
||||
<path
|
||||
sodipodi:nodetypes="ccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3061"
|
||||
d="M 47.961917,54.589181 41.971985,54.93664 42.456828,7.4046722 48.446759,7.057214 Z"
|
||||
style="fill:#d3d7cf;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||
<path
|
||||
sodipodi:nodetypes="cc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3063"
|
||||
d="M 43.893094,53.518662 44.529008,8.5910005"
|
||||
style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||
<path
|
||||
d="M 36.835821,11.080021 A 8.9934077,8.993818 71.700584 1 1 53.483213,17.892275 8.9934077,8.993818 71.700584 1 1 36.835821,11.080021 Z"
|
||||
d="M 84.142492,9.234073 A 8.9934077,8.993818 71.700584 1 1 100.78988,16.046327 8.9934077,8.993818 71.700584 1 1 84.142492,9.234073 Z"
|
||||
id="path4250-71"
|
||||
style="fill:none;stroke:#2e2900;stroke-width:1.99999988;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
d="M 38.693329,11.845948 A 7.0000001,6.9999997 71.680161 1 1 51.65031,17.148455 7.0000001,6.9999997 71.680161 0 1 38.693329,11.845948 Z"
|
||||
d="M 86,10 A 7.0000001,6.9999997 71.680161 1 1 98.956981,15.302507 7.0000001,6.9999997 71.680161 0 1 86,10 Z"
|
||||
id="path4250-7-3"
|
||||
style="fill:url(#linearGradient1029);fill-opacity:1;stroke:#729fcf;stroke-width:1.99999952;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
d="M 36.252242,49.956408 A 8.9934077,8.993818 71.700584 1 1 52.899634,56.768663 8.9934077,8.993818 71.700584 1 1 36.252242,49.956408 Z"
|
||||
id="path4250-71-6"
|
||||
style="fill:none;stroke:#2e2900;stroke-width:1.99999988;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
d="M 38.10975,50.722336 A 7.0000001,6.9999997 71.680161 1 1 51.066731,56.024843 7.0000001,6.9999997 71.680161 0 1 38.10975,50.722336 Z"
|
||||
id="path4250-7-3-2"
|
||||
style="fill:url(#linearGradient5064);fill-opacity:1;stroke:#729fcf;stroke-width:1.99999952;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
<g
|
||||
id="g1070">
|
||||
<circle
|
||||
r="19.355036"
|
||||
transform="scale(1,-1)"
|
||||
cy="-32"
|
||||
cx="32"
|
||||
id="path1198"
|
||||
style="opacity:1;vector-effect:none;fill:url(#linearGradient1045);fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:1.39999998;stroke-opacity:1" />
|
||||
<g
|
||||
id="g1224">
|
||||
<circle
|
||||
style="opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.9993701;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:1.39999998;stroke-opacity:1"
|
||||
id="path1218"
|
||||
cx="24.25209"
|
||||
cy="27.15662"
|
||||
r="4"
|
||||
inkscape:transform-center-x="14.263197"
|
||||
inkscape:transform-center-y="-7.3957316" />
|
||||
<circle
|
||||
inkscape:transform-center-y="-7.3957316"
|
||||
inkscape:transform-center-x="14.263197"
|
||||
r="4"
|
||||
cy="27.15662"
|
||||
cx="39.74791"
|
||||
id="circle1220"
|
||||
style="opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.9993701;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:1.39999998;stroke-opacity:1" />
|
||||
</g>
|
||||
<g
|
||||
transform="translate(0.862146)"
|
||||
id="g1278">
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 20.954573,38.819295 C 24,42 23.78945,44.356958 32,44"
|
||||
id="path1272"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
sodipodi:nodetypes="cc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path1274"
|
||||
d="M 41.321135,38.819295 C 38.275708,42 38.486258,44.356958 30.275708,44"
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
</g>
|
||||
<g
|
||||
id="g1270">
|
||||
<g
|
||||
id="g1250"
|
||||
transform="matrix(0.67006766,0,0,1.0078927,-29.992008,3.1156093)">
|
||||
<path
|
||||
sodipodi:nodetypes="ccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3061"
|
||||
d="M 95.268588,52.743233 89.278656,53.090692 89.763499,5.5587242 95.75343,5.211266 Z"
|
||||
style="fill:#d3d7cf;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||
<path
|
||||
sodipodi:nodetypes="cc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3063"
|
||||
d="M 91.199765,51.672714 91.835679,6.7450525"
|
||||
style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||
</g>
|
||||
<g
|
||||
id="g1258"
|
||||
transform="translate(-26.030657)">
|
||||
<g
|
||||
transform="matrix(0.3970358,0,0,0.40847587,21.54725,36.613485)"
|
||||
id="g1234">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#2e2900;stroke-width:1.99999988;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path4250-71-6"
|
||||
d="M 83.558913,48.11046 A 8.9934088,8.9938191 71.700584 1 1 100.20631,54.922715 8.9934088,8.9938191 71.700584 1 1 83.558913,48.11046 Z" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:url(#linearGradient5064);fill-opacity:1;stroke:#729fcf;stroke-width:1.99999952;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path4250-7-3-2"
|
||||
d="M 85.416421,48.876388 A 7.0000001,6.9999997 71.680161 1 1 98.373402,54.178895 7.0000001,6.9999997 71.680161 0 1 85.416421,48.876388 Z" />
|
||||
</g>
|
||||
<g
|
||||
id="g1240"
|
||||
transform="matrix(0.3970358,0,0,0.40847587,21.552691,-14.908292)">
|
||||
<path
|
||||
d="M 83.558913,48.11046 A 8.9934088,8.9938191 71.700584 1 1 100.20631,54.922715 8.9934088,8.9938191 71.700584 1 1 83.558913,48.11046 Z"
|
||||
id="path1236"
|
||||
style="fill:none;stroke:#2e2900;stroke-width:1.99999988;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
d="M 85.416421,48.876388 A 7.0000001,6.9999997 71.680161 1 1 98.373402,54.178895 7.0000001,6.9999997 71.680161 0 1 85.416421,48.876388 Z"
|
||||
id="path1238"
|
||||
style="fill:url(#linearGradient1242);fill-opacity:1;stroke:#729fcf;stroke-width:1.99999952;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 17 KiB |
@@ -295,6 +295,8 @@ TechDraw::CosmeticEdge* TaskCenterLine::calcEndPoints(std::vector<std::string> f
|
||||
Bnd_Box faceBox;
|
||||
faceBox.SetGap(0.0);
|
||||
|
||||
double scale = m_partFeat->getScale();
|
||||
|
||||
for (auto& fn: faceNames) {
|
||||
if (TechDraw::DrawUtil::getGeomTypeFromName(fn) != "Face") {
|
||||
continue;
|
||||
@@ -309,16 +311,15 @@ TechDraw::CosmeticEdge* TaskCenterLine::calcEndPoints(std::vector<std::string> f
|
||||
}
|
||||
}
|
||||
|
||||
double scale = m_partFeat->getScale();
|
||||
double Xmin,Ymin,Zmin,Xmax,Ymax,Zmax;
|
||||
faceBox.Get(Xmin,Ymin,Zmin,Xmax,Ymax,Zmax);
|
||||
|
||||
double Xspan = fabs(Xmax - Xmin);
|
||||
Xspan = (Xspan / 2.0) + (ext * scale);
|
||||
Xspan = (Xspan / 2.0) + (ext);
|
||||
double Xmid = Xmin + fabs(Xmax - Xmin) / 2.0;
|
||||
|
||||
double Yspan = fabs(Ymax - Ymin);
|
||||
Yspan = (Yspan / 2.0) + (ext * scale);
|
||||
Yspan = (Yspan / 2.0) + (ext);
|
||||
double Ymid = Ymin + fabs(Ymax - Ymin) / 2.0;
|
||||
|
||||
Base::Vector3d bbxCenter(Xmid, Ymid, 0.0);
|
||||
@@ -327,16 +328,16 @@ TechDraw::CosmeticEdge* TaskCenterLine::calcEndPoints(std::vector<std::string> f
|
||||
if (vert) {
|
||||
Base::Vector3d top(Xmid, Ymid - Yspan, 0.0);
|
||||
Base::Vector3d bottom(Xmid, Ymid + Yspan, 0.0);
|
||||
p1 = top;
|
||||
p2 = bottom;
|
||||
p1 = top / scale;
|
||||
p2 = bottom / scale;
|
||||
} else {
|
||||
Base::Vector3d left(Xmid - Xspan, Ymid, 0.0);
|
||||
Base::Vector3d right(Xmid + Xspan, Ymid, 0.0);
|
||||
p1 = left;
|
||||
p2 = right;
|
||||
p1 = left / scale;
|
||||
p2 = right / scale;
|
||||
}
|
||||
|
||||
result = new TechDraw::CosmeticEdge(p1,p2);
|
||||
result = new TechDraw::CosmeticEdge(p1, p2, scale);
|
||||
App::Color ac;
|
||||
ac.setValue<QColor>(ui->cpLineColor->color());
|
||||
result->color = ac;
|
||||
@@ -437,7 +438,7 @@ TaskDlgCenterLine::TaskDlgCenterLine(TechDraw::DrawViewPart* partFeat,
|
||||
: TaskDialog()
|
||||
{
|
||||
widget = new TaskCenterLine(partFeat,page,subNames);
|
||||
taskbox = new Gui::TaskView::TaskBox(Gui::BitmapFactory().pixmap("actions/techdraw-centerline"),
|
||||
taskbox = new Gui::TaskView::TaskBox(Gui::BitmapFactory().pixmap("actions/techdraw-facecenterline"),
|
||||
widget->windowTitle(), true, 0);
|
||||
taskbox->groupLayout()->addWidget(widget);
|
||||
Content.push_back(taskbox);
|
||||
@@ -447,7 +448,7 @@ TaskDlgCenterLine::TaskDlgCenterLine(TechDraw::DrawViewPart* partFeat,
|
||||
// : TaskDialog()
|
||||
//{
|
||||
// widget = new TaskCenterLine(partVP);
|
||||
// taskbox = new Gui::TaskView::TaskBox(Gui::BitmapFactory().pixmap("actions/techdraw-centerline"),
|
||||
// taskbox = new Gui::TaskView::TaskBox(Gui::BitmapFactory().pixmap("actions/techdraw-facecenterline"),
|
||||
// widget->windowTitle(), true, 0);
|
||||
// taskbox->groupLayout()->addWidget(widget);
|
||||
// Content.push_back(taskbox);
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="Resources/TechDraw.qrc">
|
||||
<normaloff>:/icons/actions/techdraw-centerline.svg</normaloff>:/icons/actions/techdraw-centerline.svg</iconset>
|
||||
<normaloff>:/icons/actions/techdraw-facecenterline.svg</normaloff>:/icons/actions/techdraw-facecenterline.svg</iconset>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
|
||||
@@ -156,7 +156,7 @@ Gui::ToolBarItem* Workbench::setupToolBars() const
|
||||
*anno << "TechDraw_LeaderLine";
|
||||
*anno << "TechDraw_RichAnno";
|
||||
*anno << "TechDraw_CosmeticVertexGrp";
|
||||
*anno << "TechDraw_CenterLine";
|
||||
*anno << "TechDraw_FaceCenterLine";
|
||||
*anno << "TechDraw_CosmeticEraser";
|
||||
|
||||
return root;
|
||||
@@ -218,7 +218,7 @@ Gui::ToolBarItem* Workbench::setupCommandBars() const
|
||||
*anno << "TechDraw_LeaderLine";
|
||||
*anno << "TechDraw_RichAnno";
|
||||
*anno << "TechDraw_CosmeticVertexGrp";
|
||||
*anno << "TechDraw_CenterLine";
|
||||
*anno << "TechDraw_FaceCenterLine";
|
||||
*anno << "TechDraw_CosmeticEraser";
|
||||
|
||||
return root;
|
||||
|
||||
Reference in New Issue
Block a user