https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
14namespace CSG
15{
16
21{
22protected:
27
31 CSGSurfaceList(const CSGSurfaceList & other_surface_list);
32
36 virtual ~CSGSurfaceList() = default;
37
43 std::unordered_map<std::string, std::unique_ptr<CSGSurface>> & getSurfaceListMap()
44 {
45 return _surfaces;
46 }
47
53 const std::unordered_map<std::string, std::unique_ptr<CSGSurface>> & getSurfaceListMap() const
54 {
55 return _surfaces;
56 }
57
63 std::vector<std::reference_wrapper<const CSGSurface>> getAllSurfaces() const;
64
71 bool hasSurface(const std::string & name) const
72 {
73 return _surfaces.find(name) != _surfaces.end();
74 }
75
83 CSGSurface & getSurface(const std::string & name) const;
84
95 CSGSurface & addSurface(std::unique_ptr<CSGSurface> surf,
96 const bool ignore_identical_surface = false);
97
103 void renameSurface(const CSGSurface & surface, const std::string & name);
104
106 bool operator==(const CSGSurfaceList & other) const;
107
109 bool operator!=(const CSGSurfaceList & other) const;
110
112 std::unordered_map<std::string, std::unique_ptr<CSGSurface>> _surfaces;
113
114 // Only CSGBase should be calling the methods in CSGSurfaceList
115 friend class CSGBase;
116};
117} // namespace CSG
CSGBase creates an internal representation of a Constructive Solid Geometry (CSG) model.
Definition CSGBase.h:54
CSGSurfaceList is a container for storing CSGSurface objects in the CSGBase object.
CSGSurfaceList()
Default constructor.
void renameSurface(const CSGSurface &surface, const std::string &name)
rename the specified surface
CSGSurface & addSurface(std::unique_ptr< CSGSurface > surf, const bool ignore_identical_surface=false)
add a surface object to existing SurfaceList.
std::vector< std::reference_wrapper< const CSGSurface > > getAllSurfaces() const
Get list of references to all surfaces in surface list.
CSGSurface & getSurface(const std::string &name) const
Get a surface by name.
bool operator==(const CSGSurfaceList &other) const
Operator overload for checking if two CSGSurfaceList objects are equal.
bool operator!=(const CSGSurfaceList &other) const
Operator overload for checking if two CSGSurfaceList objects are not equal.
std::unordered_map< std::string, std::unique_ptr< CSGSurface > > & getSurfaceListMap()
Get non-const map of all names to surfaces in surface list.
virtual ~CSGSurfaceList()=default
Destructor.
const std::unordered_map< std::string, std::unique_ptr< CSGSurface > > & getSurfaceListMap() const
Get const map of all names to surfaces in surface list.
std::unordered_map< std::string, std::unique_ptr< CSGSurface > > _surfaces
Mapping of surface names to pointers of stored surface objects.
bool hasSurface(const std::string &name) const
return whether surface with given name exists in surface list
CSGSurface creates an internal representation of a Constructive Solid Geometry (CSG) surface,...
Definition CSGSurface.h:27