BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
GUI::RealSpace::GeometryStore Class Reference

Description

Definition at line 95 of file geometry.h.

Inheritance diagram for GUI::RealSpace::GeometryStore:
[legend]
Collaboration diagram for GUI::RealSpace::GeometryStore:
[legend]

Signals

void deletingGeometry (Geometry const *)
 

Public Member Functions

GeometryHandle getGeometry (GeometricID::Key)
 

Private Member Functions

void geometryDeleted (Geometry const &)
 

Private Attributes

std::unordered_map< GeometricID::Key, GeometryRef, GeometricID::KeyHashm_geometries
 

Friends

class Geometry
 

Member Function Documentation

◆ deletingGeometry

void GUI::RealSpace::GeometryStore::deletingGeometry ( Geometry const *  )
signal

◆ geometryDeleted()

void GUI::RealSpace::GeometryStore::geometryDeleted ( Geometry const &  g)
private

Definition at line 170 of file geometry.cpp.

171 {
172  emit deletingGeometry(&g);
173  m_geometries.erase(g.m_key);
174 }
std::unordered_map< GeometricID::Key, GeometryRef, GeometricID::KeyHash > m_geometries
Definition: geometry.h:106
void deletingGeometry(Geometry const *)

References GUI::RealSpace::Geometry::m_key.

Referenced by GUI::RealSpace::Geometry::~Geometry().

◆ getGeometry()

GeometryHandle GUI::RealSpace::GeometryStore::getGeometry ( GeometricID::Key  key)

Definition at line 158 of file geometry.cpp.

159 {
160  auto it = m_geometries.find(key);
161  if (m_geometries.end() != it) {
162  if (auto g = it->second.lock())
163  return g;
164  }
165  GeometryHandle g(new Geometry(key));
166  m_geometries[key] = GeometryRef(g);
167  return g;
168 }
std::shared_ptr< Geometry > GeometryHandle
Definition: geometry_inc.h:27
std::weak_ptr< Geometry > GeometryRef
Definition: geometry_inc.h:28

References GUI::RealSpace::Geometry::Geometry().

Referenced by GUI::RealSpace::Object::draw().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ Geometry

friend class Geometry
friend

Definition at line 97 of file geometry.h.

Member Data Documentation

◆ m_geometries

std::unordered_map<GeometricID::Key, GeometryRef, GeometricID::KeyHash> GUI::RealSpace::GeometryStore::m_geometries
private

Definition at line 106 of file geometry.h.


The documentation for this class was generated from the following files: