[TD]support Pyramid in Balloon
This commit is contained in:
@@ -71,10 +71,30 @@ using namespace TechDraw;
|
||||
|
||||
PROPERTY_SOURCE(TechDraw::DrawViewBalloon, TechDraw::DrawView)
|
||||
|
||||
const char* DrawViewBalloon::endTypeEnums[]= {"Arrow",
|
||||
"Dot",
|
||||
//from Gui/QGIArrow.h
|
||||
//enum ArrowType {
|
||||
// FILLED_TRIANGLE = 0,
|
||||
// OPEN_ARROW,
|
||||
// HASH_MARK,
|
||||
// DOT,
|
||||
// OPEN_CIRCLE,
|
||||
// FORK,
|
||||
// PYRAMID
|
||||
// };
|
||||
|
||||
const char* DrawViewBalloon::endTypeEnums[]= { "FILLED_TRIANGLE",
|
||||
"OPEN_ARROW",
|
||||
"HASH_MARK",
|
||||
"DOT",
|
||||
"OPEN_CIRCLE",
|
||||
"FORK",
|
||||
"PYRAMID",
|
||||
NULL};
|
||||
|
||||
//const char* DrawViewBalloon::endTypeEnums[]= {"Arrow",
|
||||
// "Dot",
|
||||
// NULL};
|
||||
|
||||
const char* DrawViewBalloon::balloonTypeEnums[]= {"Circular",
|
||||
"None",
|
||||
"Triangle",
|
||||
|
||||
@@ -36,13 +36,13 @@ namespace TechDrawGui
|
||||
{
|
||||
|
||||
enum ArrowType {
|
||||
FILLED_TRIANGLE = 0,
|
||||
OPEN_ARROW,
|
||||
HASH_MARK,
|
||||
DOT,
|
||||
OPEN_CIRCLE,
|
||||
FORK,
|
||||
PYRAMID
|
||||
FILLED_TRIANGLE = 0,
|
||||
OPEN_ARROW,
|
||||
HASH_MARK,
|
||||
DOT,
|
||||
OPEN_CIRCLE,
|
||||
FORK,
|
||||
PYRAMID
|
||||
};
|
||||
|
||||
class TechDrawGuiExport QGIArrow : public QGIPrimPath
|
||||
|
||||
@@ -491,7 +491,6 @@ void QGILeaderLine::setArrows(std::vector<QPointF> pathPoints)
|
||||
Base::Vector3d stdX(1.0,0.0,0.0);
|
||||
TechDraw::DrawLeaderLine* featLeader = getFeature();
|
||||
|
||||
double baseScale = featLeader->getBaseScale();
|
||||
QPointF lastOffset = (pathPoints.back() - pathPoints.front());
|
||||
|
||||
if (featLeader->StartSymbol.getValue() > -1) {
|
||||
|
||||
@@ -639,13 +639,16 @@ void QGIViewBalloon::draw_modifier(bool modifier)
|
||||
balloonLines->setPath(dLinePath);
|
||||
balloonShape->setPath(balloonPath);
|
||||
|
||||
const char *endType = balloon->EndType.getValueAsString();
|
||||
// const char *endType = balloon->EndType.getValueAsString();
|
||||
|
||||
if (strcmp(endType, "Arrow") == 0) {
|
||||
arrow->setStyle(QGIArrow::getPrefArrowStyle());
|
||||
} else if (strcmp(endType, "Dot") == 0) {
|
||||
arrow->setStyle(3);
|
||||
}
|
||||
// if (strcmp(endType, "FILLED_TRIANGLE") == 0) {
|
||||
// arrow->setStyle(QGIArrow::getPrefArrowStyle());
|
||||
// } else if (strcmp(endType, "DOT") == 0) {
|
||||
// arrow->setStyle(3);
|
||||
// }
|
||||
|
||||
int endType = balloon->EndType.getValue();
|
||||
arrow->setStyle(endType);
|
||||
|
||||
arrow->setSize(QGIArrow::getPrefArrowSize());
|
||||
arrow->draw();
|
||||
@@ -755,4 +758,12 @@ QColor QGIViewBalloon::getNormalColor()
|
||||
return m_colNormal;
|
||||
}
|
||||
|
||||
int QGIViewBalloon::prefDefaultArrow() const
|
||||
{
|
||||
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
||||
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Dimensions");
|
||||
int arrow = hGrp->GetInt("BalloonArrow", QGIArrow::getPrefArrowStyle());
|
||||
return arrow;
|
||||
}
|
||||
|
||||
#include <Mod/TechDraw/Gui/moc_QGIViewBalloon.cpp>
|
||||
|
||||
@@ -137,12 +137,15 @@ public:
|
||||
virtual void paint( QPainter * painter,
|
||||
const QStyleOptionGraphicsItem * option,
|
||||
QWidget * widget = 0 ) override;
|
||||
virtual QColor getNormalColor(void) override;
|
||||
QString getLabelText(void);
|
||||
void draw_modifier(bool modifier);
|
||||
void placeBalloon(QPointF pos);
|
||||
TechDraw::DrawViewBalloon *dvBalloon;
|
||||
|
||||
virtual QColor getNormalColor(void) override;
|
||||
int prefDefaultArrow() const;
|
||||
|
||||
|
||||
public Q_SLOTS:
|
||||
void balloonLabelDragged(bool ctrl);
|
||||
void balloonLabelDragFinished(void);
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<widget class="QComboBox" name="comboEndType">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Arrow</string>
|
||||
<string>FILLED_TRIANGLE</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="Resources/TechDraw.qrc">
|
||||
@@ -40,13 +40,58 @@
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Dot</string>
|
||||
<string>OPEN_ARROW</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="Resources/TechDraw.qrc">
|
||||
<normaloff>:/icons/arrowopen.svg</normaloff>:/icons/arrowopen.svg</iconset>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>HASH_MARK</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="Resources/TechDraw.qrc">
|
||||
<normaloff>:/icons/arrowtick.svg</normaloff>:/icons/arrowtick.svg</iconset>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>DOT</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="Resources/TechDraw.qrc">
|
||||
<normaloff>:/icons/arrowdot.svg</normaloff>:/icons/arrowdot.svg</iconset>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>OPEN_CIRCLE</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="Resources/TechDraw.qrc">
|
||||
<normaloff>:/icons/arrowopendot.svg</normaloff>:/icons/arrowopendot.svg</iconset>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>FORK</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="Resources/TechDraw.qrc">
|
||||
<normaloff>:/icons/arrowfork.svg</normaloff>:/icons/arrowfork.svg</iconset>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>PYRAMID</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="Resources/TechDraw.qrc">
|
||||
<normaloff>:/icons/arrowpyramid.svg</normaloff>:/icons/arrowpyramid.svg</iconset>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
|
||||
Reference in New Issue
Block a user