Part/Sketcher: Refactor Geometry Extensions copy/save/restore AND attachment notification
========================================================================================= - Long overdue refactor to avoid repetition during save/restore and copy. - New interface to notify an extension when it is attached. It also enables the extension to gain a pointer to the geometry container. This is intended to extend the functionality already existing in Part::Geometry.
This commit is contained in:
committed by
abdullahtahiriyo
parent
6c6790e8b5
commit
b69b3c71c0
@@ -41,16 +41,20 @@ SolverGeometryExtension::SolverGeometryExtension():
|
||||
|
||||
}
|
||||
|
||||
void SolverGeometryExtension::copyAttributes(Part::GeometryExtension * cpy) const
|
||||
{
|
||||
Part::GeometryExtension::copyAttributes(cpy);
|
||||
static_cast<SolverGeometryExtension *>(cpy)->Edge = this->Edge;
|
||||
static_cast<SolverGeometryExtension *>(cpy)->Start = this->Start;
|
||||
static_cast<SolverGeometryExtension *>(cpy)->End = this->End;
|
||||
static_cast<SolverGeometryExtension *>(cpy)->Mid = this->Mid;
|
||||
}
|
||||
|
||||
std::unique_ptr<Part::GeometryExtension> SolverGeometryExtension::copy(void) const
|
||||
{
|
||||
auto cpy = std::make_unique<SolverGeometryExtension>();
|
||||
|
||||
cpy->Edge = this->Edge;
|
||||
cpy->Start = this->Start;
|
||||
cpy->End = this->End;
|
||||
cpy->Mid = this->Mid;
|
||||
|
||||
cpy->setName(this->getName()); // Base Class
|
||||
copyAttributes(cpy.get());
|
||||
|
||||
#if defined (__GNUC__) && (__GNUC__ <=4)
|
||||
return std::move(cpy);
|
||||
|
||||
Reference in New Issue
Block a user