Pointwise Plugin SDK
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
CaeStrBoundary.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * CaeStrBoundary class
4  *
5  * (C) 2021 Cadence Design Systems, Inc. All rights reserved worldwide.
6  *
7  ***************************************************************************/
8 
9 #if !defined(PWGM_HIDE_STRUCTURED_API)
10 
11 #ifndef _CAESTRBOUNDARY_H_
12 #define _CAESTRBOUNDARY_H_
13 
14 #include "apiGridModel.h"
15 #include "apiPWP.h"
16 #include "CaeStrBoundaryGroup.h"
17 #include "CaeStrGridModel.h"
18 
19 
63 public:
64 
66 
72  PWGM_HBNDRY_SET_INVALID(h_);
73  }
74 
76 
84  PWGM_HBNDRY_SET_INVALID(h_);
85  moveTo(group, ndx);
86  }
87 
89 
94  group_ = src.group_;
95  h_ = src.h_;
96  groupNdx_ = src.groupNdx_;
97  }
98 
101  }
102 
106  }
107 
109 
114  PWP_UINT32 index() const {
115  return groupNdx_;
116  }
117 
119 
126  return PWGM_HBNDRY_ID(h_);
127  }
128 
130 
134  bool data(PWGM_BNDRYDATA &data) const {
135  return 0 != PwBoundary(h_, &data);
136  }
137 
139 
143  bool data(PWGM_CONDDATA &data) const {
144  return 0 != PwBndryCondition(h_, &data);
145  }
146 
148 
155  bool data(PWGM_BNDRYDATA &bData, PWGM_CONDDATA &cData) const {
157  PWGM_HBNDRY_ID(h_), &bData, &cData);
158  }
159 
162  bool isValid() const {
163  return PWGM_HBNDRY_ISVALID(h_);
164  }
165 
167 
173  group_ = rhs.group_;
174  h_ = rhs.h_;
175  groupNdx_ = rhs.groupNdx_;
176  return *this;
177  }
178 
180 
188  group_ = &group;
189  return moveTo(ndx);
190  }
191 
193 
201  if (0 != group_) {
202  groupNdx_ = ndx;
204  }
205  return *this;
206  }
207 
209 
216  group_ = &group;
217  return moveTo(0);
218  }
219 
221 
227  groupNdx_ = 0;
228  if (0 != group_) {
230  }
231  return *this;
232  }
233 
235 
242  return moveTo(groupNdx_ + 1);
243  }
244 
246 
254  return moveTo(groupNdx_ + 1);
255  }
256 
258 
265  CaeStrBoundary ret = *this;
266  moveTo(groupNdx_ + 1);
267  return ret;
268  }
269 
271 
278  return moveTo(groupNdx_ - 1);
279  }
280 
282 
290  return moveTo(groupNdx_ - 1);
291  }
292 
294 
301  CaeStrBoundary ret = *this;
302  moveTo(groupNdx_ - 1);
303  return ret;
304  }
305 
307  friend bool operator==(const PWGM_HBNDRY &h1, const PWGM_HBNDRY &h2);
309 
311 
315  bool operator==(const CaeStrBoundary &rhs) const {
316  return (rhs.group_ == group_) && (rhs.h_ == h_);
317  }
318 
320 
324  bool operator!=(const CaeStrBoundary &rhs) const {
325  return !(rhs == *this);
326  }
327 
329  friend bool operator<(const PWGM_HBNDRY &h1, const PWGM_HBNDRY &h2);
331 
333 
336  bool operator<(const CaeStrBoundary &rhs) const {
337  if (rhs.group_ < group_) {
338  return true;
339  }
340  else if (rhs.group_ > group_) {
341  return false;
342  }
343  return h_ < rhs.h_;
344  }
345 
347 
350  bool operator>(const PWGM_HBNDRY &rhs)
351  {
352  return !(*this == rhs) && !(*this < rhs);
353  }
354 
356  operator PWGM_HBNDRY() const {
357  return h_;
358  }
359 
360 protected:
361 
365 };
366 
367 #endif // _CAESTRBOUNDARY_H_
368 
369 #endif // PWGM_HIDE_STRUCTURED_API
bool operator>(const PWGM_HBNDRY &rhs)
Compares the relative order of two CaeStrBoundary instances.
PWP_BOOL PwModNdxBoundaryAndCondition(PWGM_HGRIDMODEL model, PWP_UINT32 ndx, PWGM_BNDRYDATA *pBndryData, PWGM_CONDDATA *pCondData)
Get the PWGM_BNDRYDATA and PWGM_CONDDATA for the model&#39;s nth structured boundary. ...
CaeStrBoundary & moveNext()
Rebinds an instance to the next boundary in the group.
unsigned int PWP_UINT32
32-bit unsigned integer
Definition: apiPWP.h:210
PWP_BOOL PwBndryCondition(PWGM_HBNDRY boundary, PWGM_CONDDATA *pCondData)
Get the boundary&#39;s condition data.
#define PWGM_HBNDRY_MODEL(h)
gets the boundary&#39;s parent PWGM_HGRIDMODEL handle
Definition: apiGridModel.h:477
#define PWGM_HBNDRY_ISVALID(h)
returns non-zero value if handle is valid
Definition: apiGridModel.h:459
Pointwise Plugin API (PWP-API)
CaeStrBoundary & operator++()
Prefix increment to the next boundary in the group.
CaeStrBoundary()
Default constructor.
Pointwise Grid Model API Specification (PWGM-API)
CaeStrBoundary & moveTo(PWP_UINT32 ndx)
Rebinds an instance to a specific boundary within the current group.
CaeStrBoundary & moveFirst(const CaeStrBoundaryGroup &group)
Rebinds an instance to the first boundary in the group.
CaeStrBoundary operator--(int)
Postfix decrement to the previous boundary in the group.
bool data(PWGM_BNDRYDATA &data) const
Get information about the boundary.
PWP_UINT32 index() const
Get the boundary&#39;s index in the group.
#define PWGM_HBNDRY_ID(h)
gets the boundary&#39;s guid from the handle
Definition: apiGridModel.h:475
PWP_BOOL PwBoundary(PWGM_HBNDRY boundary, PWGM_BNDRYDATA *pBndryData)
Get the boundary data.
An opaque handle to a structured block boundary.
Definition: apiGridModel.h:457
CaeStrBoundary & operator--()
Prefix decrement to the previous boundary in the group.
bool operator==(const CaeStrBoundary &rhs) const
Compares two CaeStrBoundary instances for equality.
CaeStrBoundary(const CaeStrBoundary &src)
Copy constructor.
CaeStrGridModel model() const
Gets the structured grid model of which this boundary is a member.
CaeStrBoundary & operator=(const CaeStrBoundary &rhs)
Assignment operator.
CaeStrBoundary & movePrev()
Rebinds an instance to the previous boundary in the group.
bool isValid() const
Determines a boundary&#39;s validity.
The structured boundary group class.
The structured boundary class.
CaeStrBoundary operator++(int)
Postfix increment to the next boundary in the group.
CaeStrBoundary(const CaeStrBoundaryGroup &group, PWP_UINT32 ndx=0)
Group and boundary index constructor.
bool operator<(const CaeStrBoundary &rhs) const
Compares the relative order of two CaeStrBoundary instances.
bool data(PWGM_CONDDATA &data) const
Gets the boundary&#39;s condition data.
bool operator!=(const CaeStrBoundary &rhs) const
Compares two CaeStrBoundary instances for inequality.
The structured grid model class.
PWP_UINT32 modelIndex() const
Get the boundary&#39;s model index.
Condition descriptor data type.
Definition: apiGridModel.h:644
PWP_UINT32 groupNdx_
The current index in the group&#39;s index space.
bool data(PWGM_BNDRYDATA &bData, PWGM_CONDDATA &cData) const
Get both the boundary information and condition data.
Structured grid boundary data type.
Definition: apiGridModel.h:951
CaeStrBoundary & moveTo(const CaeStrBoundaryGroup &group, PWP_UINT32 ndx)
Rebinds an instance to a specific group and boundary.
const CaeStrBoundaryGroup * group_
The owning boundary group.
PWGM_HBNDRY enumBoundaries(PWP_UINT32 ndx) const
Get a boundary in the group.
CaeStrBoundary & moveFirst()
Rebinds an instance to the first boundary in the current group.
PWGM_HBNDRY h_
The bound PWGM_HBNDRY.
~CaeStrBoundary()
Destructor.