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.
PolarArray.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_POLARARRAY_H_
30 #define NEMOSYS_POLARARRAY_H_
31 
32 #include "nemosys_export.h"
33 #include "NucMesh/ShapesArray.H"
34 
35 #include <array>
36 
37 namespace NEM {
38 namespace NUCMESH {
39 
40 /**
41  * Arrange a series of other @c ShapeBase objects along a circular arc.
42  */
43 class NEMOSYS_EXPORT PolarArray : public ShapesArray {
44  public:
45  PolarArray(std::size_t numSubshapes, double startAngle, double endAngle,
46  double radius, bool rotateWithArray = false,
47  const std::array<double, 3> &center = {0, 0, 0});
48 
50  /**
51  * The shape at pattern index @c i will be, for <tt> theta = i *
52  * std::fmod(getEndAngle() - getStartAngle(), 360.) </tt>, translated by <tt>
53  * ShapeBase::getRotatedPoint(getCenter(), {getRadius(), theta}) </tt> and (if
54  * @c rotatewithArray) rotated about [0, 0, 1] by @c theta.
55  */
57 
58  std::size_t getNumSubshapes() const { return numShapesInArr_; }
59  double getRadius() const { return radius_; }
60  void setRadius(double radius) { radius_ = radius; }
61  double getStartAngle() const { return start_; }
62  void setStartAngle(double startAngle) { start_ = startAngle; }
63  double getEndAngle() const { return end_; }
64  void setEndAngle(double endAngle) { end_ = endAngle; }
65  bool getRotateWithArray() const { return rotateWithArray_; }
66  void setRotateWithArray(bool rotateWithArray) {
67  rotateWithArray_ = rotateWithArray;
68  }
69 
70  protected:
71  NEM::GEO::GeoManager createGeo() const override;
72 
73  private:
74  std::size_t numShapesInArr_;
75  double radius_;
76  double start_;
77  double end_;
79 };
80 
81 } // namespace NUCMESH
82 } // namespace NEM
83 
84 #endif // NEMOSYS_POLARARRAY_H_
void setEndAngle(double endAngle)
Definition: PolarArray.H:64
Class to manage TopoDS_Shapes along with metadata.
Definition: GeoManager.H:61
double getRadius() const
Definition: PolarArray.H:59
Arrange a series of other ShapeBase objects along a circular arc.
Definition: PolarArray.H:43
void setRotateWithArray(bool rotateWithArray)
Definition: PolarArray.H:66
bool getRotateWithArray() const
Definition: PolarArray.H:65
std::size_t numShapesInArr_
Definition: PolarArray.H:74
double getEndAngle() const
Definition: PolarArray.H:63
double getStartAngle() const
Definition: PolarArray.H:61
void setRadius(double radius)
Definition: PolarArray.H:60
Abstract base class representing a set of other ShapeBase objects, with a transformation applied to e...
Definition: ShapesArray.H:52
void setStartAngle(double startAngle)
Definition: PolarArray.H:62
std::size_t getNumSubshapes() const
Definition: PolarArray.H:58
void setPattern(std::size_t idx, std::size_t patternKey)
Definition: ShapesArray.C:77
const std::size_t & getPattern(std::size_t idx) const
Definition: ShapesArray.C:73