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
927fdc9edc
commit
e6af511f39
@@ -39,13 +39,17 @@ ViewProviderSketchGeometryExtension::ViewProviderSketchGeometryExtension():Repre
|
||||
|
||||
}
|
||||
|
||||
void ViewProviderSketchGeometryExtension::copyAttributes(Part::GeometryExtension * cpy) const
|
||||
{
|
||||
Part::GeometryExtension::copyAttributes(cpy);
|
||||
static_cast<ViewProviderSketchGeometryExtension *>(cpy)->RepresentationFactor = this->RepresentationFactor;
|
||||
}
|
||||
|
||||
std::unique_ptr<Part::GeometryExtension> ViewProviderSketchGeometryExtension::copy(void) const
|
||||
{
|
||||
auto cpy = std::make_unique<ViewProviderSketchGeometryExtension>();
|
||||
|
||||
cpy->RepresentationFactor = this->RepresentationFactor;
|
||||
|
||||
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