https://mooseframework.inl.gov
CSGSurfaceList.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include "CSGSurface.h"
13 
14 namespace CSG
15 {
16 
21 {
22 protected:
27 
31  virtual ~CSGSurfaceList() = default;
32 
38  std::unordered_map<std::string, std::unique_ptr<CSGSurface>> & getSurfaceListMap()
39  {
40  return _surfaces;
41  }
42 
48  std::vector<std::reference_wrapper<const CSGSurface>> getAllSurfaces() const;
49 
57  CSGSurface & getSurface(const std::string & name) const;
58 
67  CSGSurface & addSurface(std::unique_ptr<CSGSurface> surf);
68 
74  void renameSurface(const CSGSurface & surface, const std::string & name);
75 
77  std::unordered_map<std::string, std::unique_ptr<CSGSurface>> _surfaces;
78 
79  // Only CSGBase should be calling the methods in CSGSurfaceList
80  friend class CSGBase;
81 };
82 } // namespace CSG
CSGSurface & getSurface(const std::string &name) const
Get a surface by name.
std::vector< std::reference_wrapper< const CSGSurface > > getAllSurfaces() const
Get list of references to all surfaces in surface list.
std::unordered_map< std::string, std::unique_ptr< CSGSurface > > _surfaces
Mapping of surface names to pointers of stored surface objects.
void renameSurface(const CSGSurface &surface, const std::string &name)
rename the specified surface
std::unordered_map< std::string, std::unique_ptr< CSGSurface > > & getSurfaceListMap()
Get map of all names to surfaces in surface list.
virtual ~CSGSurfaceList()=default
Destructor.
CSGSurfaceList()
Default constructor.
CSGSurfaceList is a container for storing CSGSurface objects in the CSGBase object.
CSGSurface creates an internal representation of a Constructive Solid Geometry (CSG) surface...
Definition: CSGSurface.h:26
CSGSurface & addSurface(std::unique_ptr< CSGSurface > surf)
add a surface object to existing SurfaceList.
CSGBase creates an internal representation of a Constructive Solid Geometry (CSG) model...
Definition: CSGBase.h:29