[TD]correct PropertyFileIncluded handling in Welding
This commit is contained in:
@@ -62,13 +62,49 @@ DrawWeldSymbol::DrawWeldSymbol(void)
|
||||
Caption.setStatus(App::Property::Hidden,true);
|
||||
Scale.setStatus(App::Property::Hidden,true);
|
||||
ScaleType.setStatus(App::Property::Hidden,true);
|
||||
|
||||
}
|
||||
|
||||
DrawWeldSymbol::~DrawWeldSymbol()
|
||||
{
|
||||
}
|
||||
|
||||
//DWS always has exactly 2 child tiles - ArrowSide and OtherSide.
|
||||
//OtherSide tile may be hidden;
|
||||
//once DWS has been added to the document, add 2x DrawTileWeld
|
||||
//but if this is a restore of an existing DWS, the tiles will loaded elsewhere
|
||||
void DrawWeldSymbol::onSettingDocument()
|
||||
{
|
||||
// Base::Console().Message("DWS::onSettingDocument() - doc: %s\n", getDocument()->getName());
|
||||
App::Document* doc = getDocument();
|
||||
|
||||
if (doc->testStatus(App::Document::Status::Restoring)) {
|
||||
// Base::Console().Message("DWS::onSettingDocument() - restoring!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<DrawTileWeld*> existingTiles = getTiles();
|
||||
if (!existingTiles.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::string tileName1 = doc->getUniqueObjectName("DrawTileWeld");
|
||||
auto tile1Obj( doc->addObject( "TechDraw::DrawTileWeld", tileName1.c_str() ) );
|
||||
DrawTileWeld* tile1 = dynamic_cast<DrawTileWeld*>(tile1Obj);
|
||||
if (tile1 != nullptr) {
|
||||
tile1->TileParent.setValue(this);
|
||||
}
|
||||
|
||||
std::string tileName2 = doc->getUniqueObjectName("DrawTileWeld");
|
||||
auto tile2Obj( doc->addObject( "TechDraw::DrawTileWeld", tileName2.c_str() ) );
|
||||
DrawTileWeld* tile2 = dynamic_cast<DrawTileWeld*>(tile2Obj);
|
||||
if (tile2 != nullptr) {
|
||||
tile2->TileParent.setValue(this);
|
||||
}
|
||||
tile2->TileRow.setValue(-1); //other side is row -1
|
||||
|
||||
DrawView::onSettingDocument();
|
||||
}
|
||||
|
||||
void DrawWeldSymbol::onChanged(const App::Property* prop)
|
||||
{
|
||||
if (!isRestoring()) {
|
||||
@@ -95,7 +131,6 @@ App::DocumentObjectExecReturn *DrawWeldSymbol::execute(void)
|
||||
std::vector<DrawTileWeld*> DrawWeldSymbol::getTiles(void) const
|
||||
{
|
||||
// Base::Console().Message("DWS::getTiles()\n");
|
||||
// std::vector<App::DocumentObject*> temp;
|
||||
std::vector<DrawTileWeld*> result;
|
||||
|
||||
std::vector<App::DocumentObject*> tiles = getInList();
|
||||
|
||||
Reference in New Issue
Block a user