Extensions: GeoFeatureGroup only for GeoFeature
This commit is contained in:
@@ -45,21 +45,36 @@ EXTENSION_PROPERTY_SOURCE(App::GeoFeatureGroupExtension, App::GroupExtension)
|
||||
|
||||
GeoFeatureGroupExtension::GeoFeatureGroupExtension(void)
|
||||
{
|
||||
initExtension(GeoFeatureGroupExtension::getExtensionClassTypeId());
|
||||
|
||||
EXTENSION_ADD_PROPERTY(Placement,(Base::Placement()));
|
||||
initExtensionType(GeoFeatureGroupExtension::getExtensionClassTypeId());
|
||||
}
|
||||
|
||||
GeoFeatureGroupExtension::~GeoFeatureGroupExtension(void)
|
||||
{
|
||||
}
|
||||
|
||||
void GeoFeatureGroupExtension::initExtension(ExtensionContainer* obj) {
|
||||
|
||||
if(!obj->isDerivedFrom(App::GeoFeature::getClassTypeId()))
|
||||
throw Base::Exception("GeoFeatureGroupExtension can only be applied to GeoFeatures");
|
||||
|
||||
App::Extension::initExtension(obj);
|
||||
}
|
||||
|
||||
PropertyPlacement& GeoFeatureGroupExtension::placement() {
|
||||
|
||||
if(!getExtendedContainer())
|
||||
throw Base::Exception("GeoFeatureGroupExtension was not applied to GeoFeature");
|
||||
|
||||
return static_cast<App::GeoFeature*>(getExtendedContainer())->Placement;
|
||||
}
|
||||
|
||||
|
||||
void GeoFeatureGroupExtension::transformPlacement(const Base::Placement &transform)
|
||||
{
|
||||
// NOTE: Keep in sync with APP::GeoFeature
|
||||
Base::Placement plm = this->Placement.getValue();
|
||||
Base::Placement plm = this->placement().getValue();
|
||||
plm = transform * plm;
|
||||
this->Placement.setValue(plm);
|
||||
this->placement().setValue(plm);
|
||||
}
|
||||
|
||||
std::vector<App::DocumentObject*> GeoFeatureGroupExtension::getGeoSubObjects () const {
|
||||
|
||||
Reference in New Issue
Block a user