[TechDraw] Improve readability of DrawWeldSymbol.cpp
This commit is contained in:
committed by
WandererFan
parent
692838bd53
commit
abaee2d0fe
@@ -108,9 +108,6 @@ void DrawWeldSymbol::onSettingDocument()
|
||||
|
||||
void DrawWeldSymbol::onChanged(const App::Property* prop)
|
||||
{
|
||||
if (!isRestoring()) {
|
||||
//nothing in particular
|
||||
}
|
||||
DrawView::onChanged(prop);
|
||||
}
|
||||
|
||||
@@ -135,13 +132,15 @@ std::vector<DrawTileWeld*> DrawWeldSymbol::getTiles(void) const
|
||||
std::vector<DrawTileWeld*> result;
|
||||
|
||||
std::vector<App::DocumentObject*> tiles = getInList();
|
||||
if (!tiles.empty()) {
|
||||
for(std::vector<App::DocumentObject *>::iterator it = tiles.begin(); it != tiles.end(); it++) {
|
||||
if ((*it)->getTypeId().isDerivedFrom(TechDraw::DrawTileWeld::getClassTypeId())) {
|
||||
App::DocumentObject* doTemp = (*it);
|
||||
DrawTileWeld* temp = static_cast<DrawTileWeld*>(doTemp);
|
||||
result.push_back(temp);
|
||||
}
|
||||
if (tiles.empty()) {
|
||||
return result;
|
||||
}
|
||||
|
||||
for(std::vector<App::DocumentObject *>::iterator it = tiles.begin(); it != tiles.end(); it++) {
|
||||
if ((*it)->getTypeId().isDerivedFrom(TechDraw::DrawTileWeld::getClassTypeId())) {
|
||||
App::DocumentObject* doTemp = (*it);
|
||||
DrawTileWeld* temp = static_cast<DrawTileWeld*>(doTemp);
|
||||
result.push_back(temp);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@@ -149,17 +148,16 @@ std::vector<DrawTileWeld*> DrawWeldSymbol::getTiles(void) const
|
||||
|
||||
bool DrawWeldSymbol::isTailRightSide()
|
||||
{
|
||||
bool result = true;
|
||||
App::DocumentObject* obj = Leader.getValue();
|
||||
TechDraw::DrawLeaderLine* realLeader = dynamic_cast<TechDraw::DrawLeaderLine*>(obj);
|
||||
if (realLeader) {
|
||||
Base::Vector3d tail = realLeader->getTailPoint();
|
||||
Base::Vector3d kink = realLeader->getKinkPoint();
|
||||
if (tail.x < kink.x) { //tail is to left
|
||||
result = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user