NEMoSys  0.63.0
A modular, extensible resource with robust automated mesh generation, mesh quality analysis, adaptive mesh refinement, and data transfer between arbitrary meshes.
ShapeData.H
Go to the documentation of this file.
1 /*******************************************************************************
2 * Promesh *
3 * Copyright (C) 2022, IllinoisRocstar LLC. All rights reserved. *
4 * *
5 * Promesh is the property of IllinoisRocstar LLC. *
6 * *
7 * IllinoisRocstar LLC *
8 * Champaign, IL *
9 * www.illinoisrocstar.com *
10 * promesh@illinoisrocstar.com *
11 *******************************************************************************/
12 /*******************************************************************************
13 * This file is part of Promesh *
14 * *
15 * This version of Promesh is free software: you can redistribute it and/or *
16 * modify it under the terms of the GNU Lesser General Public License as *
17 * published by the Free Software Foundation, either version 3 of the License, *
18 * or (at your option) any later version. *
19 * *
20 * Promesh is distributed in the hope that it will be useful, but WITHOUT ANY *
21 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *
22 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more *
23 * details. *
24 * *
25 * You should have received a copy of the GNU Lesser General Public License *
26 * along with this program. If not, see <https://www.gnu.org/licenses/>. *
27 * *
28 *******************************************************************************/
29 #ifndef NEMOSYS_SHAPEDATA_H_
30 #define NEMOSYS_SHAPEDATA_H_
31 
32 #include "nemosys_export.h"
33 
34 #include <memory>
35 #include <vector>
36 
37 class TopoDS_Shape;
38 template <typename T>
41 
42 namespace NEM {
43 namespace GEO {
44 
45 class GeoManager;
46 
47 /**
48  * Data stored in an instance of @c GeoManager
49  */
50 class NEMOSYS_EXPORT ShapeData {
51  public:
52  virtual ~ShapeData() = default;
53 
54  /**
55  * @brief Method that is called when a geometry operation generates new shapes
56  * @details Default implementation does nothing
57  * @param[in] shape Argument to operation; shape existing in @p geoMetadata
58  * @param[in] generatedShapes Shapes provided by a call to @c
59  * op.Generated(shape) for some geometry operation
60  * @param[in,out] geoMetadata Geometry-to-data map to alter
61  */
62  virtual void updateGenerated(const TopoDS_Shape &shape,
63  const TopTools_ListOfShape &generatedShapes,
64  GeoManager &geoMetadata) const {};
65 
66  /**
67  * @brief Method that is called when a geometry operation modifies @p shape
68  * @param[in] shape Argument to operation; shape existing in @p geoMetadata
69  * @param[in] modifiedShapes Shapes provided by a call to @c
70  * op.Modified(shape) for some geometry operation
71  * @param[in,out] geoMetadata Geometry-to-data map to alter
72  */
73  virtual void updateModified(const TopoDS_Shape &shape,
74  const TopTools_ListOfShape &modifiedShapes,
75  GeoManager &geoMetadata) const = 0;
76 
77  /**
78  * @brief Method that is called when @p geoMetadata removes @p shape
79  * @details Default implementation does nothing
80  * @param[in] shape Shape to be removed
81  * @param[in,out] geoMetadata Geometry-to-data map to alter
82  */
83  virtual void updateDeleted(const TopoDS_Shape &shape,
84  GeoManager &geoMetadata) {};
85 
86  protected:
87  ShapeData() = default;
88  ShapeData(const ShapeData &) = default;
89  ShapeData(ShapeData &&) = default;
90  ShapeData &operator=(const ShapeData &) = default;
91  ShapeData &operator=(ShapeData &&) = default;
92 };
93 
94 } // namespace GEO
95 } // namespace NEM
96 
97 #endif // NEMOSYS_SHAPEDATA_H_
Class to manage TopoDS_Shapes along with metadata.
Definition: GeoManager.H:61
virtual void updateGenerated(const TopoDS_Shape &shape, const TopTools_ListOfShape &generatedShapes, GeoManager &geoMetadata) const
Method that is called when a geometry operation generates new shapes.
Definition: ShapeData.H:62
Data stored in an instance of GeoManager.
Definition: ShapeData.H:50
virtual void updateDeleted(const TopoDS_Shape &shape, GeoManager &geoMetadata)
Method that is called when geoMetadata removes shape.
Definition: ShapeData.H:83