tchnical commit
This commit is contained in:
parent
81b4bcd4af
commit
1ca23c33c7
|
@ -105,19 +105,8 @@ PartDesign::Body *Workbench::setUpPart(const App::Part *part)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Workbench::_doMigration(const App::Document* doc)
|
||||||
void switchToDocument(const App::Document* doc)
|
|
||||||
{
|
{
|
||||||
bool groupCreated = false;
|
|
||||||
|
|
||||||
|
|
||||||
if (doc == NULL) return;
|
|
||||||
|
|
||||||
PartDesign::Body* activeBody = NULL;
|
|
||||||
std::vector<App::DocumentObject*> bodies = doc->getObjectsOfType(PartDesign::Body::getClassTypeId());
|
|
||||||
|
|
||||||
// Is there a body feature in this document?
|
|
||||||
if (bodies.empty()) {
|
|
||||||
|
|
||||||
if(doc->countObjects() != 0) {
|
if(doc->countObjects() != 0) {
|
||||||
// show a warning about the convertion
|
// show a warning about the convertion
|
||||||
|
@ -321,7 +310,26 @@ void switchToDocument(const App::Document* doc)
|
||||||
prevf = f;
|
prevf = f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void Workbench::_switchToDocument(const App::Document* doc)
|
||||||
|
{
|
||||||
|
bool groupCreated = false;
|
||||||
|
|
||||||
|
|
||||||
|
if (doc == NULL) return;
|
||||||
|
|
||||||
|
PartDesign::Body* activeBody = NULL;
|
||||||
|
std::vector<App::DocumentObject*> bodies = doc->getObjectsOfType(PartDesign::Body::getClassTypeId());
|
||||||
|
|
||||||
|
// Is there a body feature in this document?
|
||||||
|
if (bodies.empty())
|
||||||
|
{
|
||||||
|
_doMigration(doc);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// Find active body
|
// Find active body
|
||||||
for (std::vector<App::DocumentObject*>::const_iterator b = bodies.begin(); b != bodies.end(); b++) {
|
for (std::vector<App::DocumentObject*>::const_iterator b = bodies.begin(); b != bodies.end(); b++) {
|
||||||
PartDesign::Body* body = static_cast<PartDesign::Body*>(*b);
|
PartDesign::Body* body = static_cast<PartDesign::Body*>(*b);
|
||||||
|
|
|
@ -100,6 +100,10 @@ private:
|
||||||
void slotDeleteDocument(const App::Document&);
|
void slotDeleteDocument(const App::Document&);
|
||||||
// Add new objects to the body, if appropriate
|
// Add new objects to the body, if appropriate
|
||||||
//void slotNewObject(const App::DocumentObject& obj);
|
//void slotNewObject(const App::DocumentObject& obj);
|
||||||
|
|
||||||
|
void _doMigration(const App::Document* doc);
|
||||||
|
void _switchToDocument(const App::Document* doc);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace PartDesignGui
|
} // namespace PartDesignGui
|
||||||
|
|
Loading…
Reference in New Issue
Block a user