[TD]Welding Symbol Editor alpha release
This commit is contained in:
@@ -47,12 +47,12 @@ DrawTile::DrawTile(void)
|
||||
{
|
||||
static const char *group = "Tile";
|
||||
|
||||
Base::Vector3d defOrg(0.0, 0.0, 0.0);
|
||||
// Base::Vector3d defOrg(0.0, 0.0, 0.0);
|
||||
ADD_PROPERTY_TYPE(TileParent,(0),group,(App::PropertyType)(App::Prop_None),
|
||||
"Object to which this tile is attached");
|
||||
ADD_PROPERTY_TYPE(TileRow, (0), group, App::Prop_None, "Row in parent");
|
||||
ADD_PROPERTY_TYPE(TileColumn, (0), group, App::Prop_None, "Column in parent");
|
||||
ADD_PROPERTY_TYPE(TileOrigin, (defOrg), group, App::Prop_None, "Width limit before auto wrap");
|
||||
// ADD_PROPERTY_TYPE(TileOrigin, (defOrg), group, App::Prop_None, "Width limit before auto wrap");
|
||||
}
|
||||
|
||||
DrawTile::~DrawTile()
|
||||
@@ -81,7 +81,7 @@ App::DocumentObjectExecReturn *DrawTile::execute(void)
|
||||
|
||||
DrawView* DrawTile::getParent(void) const
|
||||
{
|
||||
Base::Console().Message("DT::getParent() - %s\n", getNameInDocument());
|
||||
// Base::Console().Message("DT::getParent() - %s\n", getNameInDocument());
|
||||
DrawView* result = nullptr;
|
||||
App::DocumentObject* baseObj = TileParent.getValue();
|
||||
if (baseObj != nullptr) {
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
App::PropertyLink TileParent; //eg DrawWeldSymbol
|
||||
App::PropertyInteger TileRow;
|
||||
App::PropertyInteger TileColumn;
|
||||
App::PropertyVector TileOrigin; //sb call to TileParent - WeldingSymbol
|
||||
/* App::PropertyVector TileOrigin; //sb call to TileParent - WeldingSymbol*/
|
||||
|
||||
virtual short mustExecute() const;
|
||||
virtual App::DocumentObjectExecReturn *execute(void);
|
||||
|
||||
@@ -74,7 +74,7 @@ short DrawTileWeld::mustExecute() const
|
||||
|
||||
App::DocumentObjectExecReturn *DrawTileWeld::execute(void)
|
||||
{
|
||||
// Base::Console().Message("DT::execute()\n");
|
||||
// Base::Console().Message("DTW::execute()\n");
|
||||
return DrawTile::execute();
|
||||
}
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
#include <Mod/TechDraw/App/DrawWeldSymbolPy.h> // generated from DrawWeldSymbolPy.xml
|
||||
|
||||
#include "DrawLeaderLine.h"
|
||||
#include "DrawTile.h"
|
||||
#include "DrawTileWeld.h"
|
||||
#include "DrawWeldSymbol.h"
|
||||
@@ -55,6 +56,7 @@ DrawWeldSymbol::DrawWeldSymbol(void)
|
||||
ADD_PROPERTY_TYPE(Leader,(0),group,(App::PropertyType)(App::Prop_None), "Parent Leader");
|
||||
ADD_PROPERTY_TYPE(AllAround, (false), group, App::Prop_None, "All Around Symbol on/off");
|
||||
ADD_PROPERTY_TYPE(FieldWeld, (false), group, App::Prop_None, "Field Weld Symbol on/off");
|
||||
ADD_PROPERTY_TYPE(AlternatingWeld, (false), group, App::Prop_None, "Alternating Weld true/false");
|
||||
ADD_PROPERTY_TYPE(TailText, (""), group, App::Prop_None, "Text at tail of symbol");
|
||||
|
||||
Caption.setStatus(App::Property::Hidden,true);
|
||||
@@ -87,7 +89,6 @@ App::DocumentObjectExecReturn *DrawWeldSymbol::execute(void)
|
||||
return App::DocumentObject::StdReturn;
|
||||
}
|
||||
|
||||
|
||||
return DrawView::execute();
|
||||
}
|
||||
|
||||
@@ -107,10 +108,25 @@ std::vector<DrawTileWeld*> DrawWeldSymbol::getTiles(void) const
|
||||
}
|
||||
}
|
||||
}
|
||||
// Base::Console().Message("DWS::getTiles - returns: %d tiles\n",result.size());
|
||||
return result;
|
||||
}
|
||||
|
||||
bool DrawWeldSymbol::isTailRightSide()
|
||||
{
|
||||
bool result = true;
|
||||
App::DocumentObject* obj = Leader.getValue();
|
||||
TechDraw::DrawLeaderLine* realLeader = dynamic_cast<TechDraw::DrawLeaderLine*>(obj);
|
||||
if (realLeader != nullptr) {
|
||||
Base::Vector3d tail = realLeader->getTailPoint();
|
||||
Base::Vector3d kink = realLeader->getKinkPoint();
|
||||
if (tail.x < kink.x) { //tail is to left
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
PyObject *DrawWeldSymbol::getPyObject(void)
|
||||
{
|
||||
if (PythonObject.is(Py::_None())) {
|
||||
|
||||
@@ -43,9 +43,9 @@ public:
|
||||
virtual ~DrawWeldSymbol();
|
||||
|
||||
App::PropertyLink Leader;
|
||||
// App::PropertyLinkList Tiles;
|
||||
App::PropertyBool AllAround;
|
||||
App::PropertyBool FieldWeld;
|
||||
App::PropertyBool AlternatingWeld;
|
||||
App::PropertyString TailText;
|
||||
|
||||
virtual short mustExecute() const;
|
||||
@@ -57,8 +57,8 @@ public:
|
||||
virtual PyObject *getPyObject(void);
|
||||
virtual QRectF getRect() const { return QRectF(0,0,1,1);}
|
||||
|
||||
bool isTailRightSide();
|
||||
std::vector<DrawTileWeld*> getTiles(void) const;
|
||||
// void addTile(App::DocumentObject* d);
|
||||
|
||||
protected:
|
||||
virtual void onChanged(const App::Property* prop);
|
||||
|
||||
Reference in New Issue
Block a user