Skip to content
Snippets Groups Projects
Commit 538fc86c authored by Matthias Puchner's avatar Matthias Puchner
Browse files

add method to create basis item of meso crystal

parent 76210863
No related branches found
No related tags found
1 merge request!413introduce layer oriented sample editor
...@@ -52,6 +52,7 @@ public: ...@@ -52,6 +52,7 @@ public:
ItemWithParticles* basisParticle() const; ItemWithParticles* basisParticle() const;
template <typename T> T* createBasis();
void setVectorA(const R3& vector_a); void setVectorA(const R3& vector_a);
void setVectorB(const R3& vector_b); void setVectorB(const R3& vector_b);
...@@ -70,4 +71,11 @@ template <typename T> T* MesoCrystalItem::setOuterShapeType() ...@@ -70,4 +71,11 @@ template <typename T> T* MesoCrystalItem::setOuterShapeType()
return setGroupPropertyType<T>(P_OUTER_SHAPE); return setGroupPropertyType<T>(P_OUTER_SHAPE);
} }
template <typename T> T* MesoCrystalItem::createBasis()
{
if (basisParticle() != nullptr)
model()->removeItem(basisParticle());
return model()->insertItem<T>(this, -1, T_BASIS_PARTICLE);
}
#endif // BORNAGAIN_GUI_MODELS_MESOCRYSTALITEM_H #endif // BORNAGAIN_GUI_MODELS_MESOCRYSTALITEM_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment