Pointwise Plugin SDK
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
CaeUnsPatch.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * CaeUnsPatch class
4  *
5  * (C) 2021 Cadence Design Systems, Inc. All rights reserved worldwide.
6  *
7  ***************************************************************************/
8 
9 #if !defined(PWGM_HIDE_UNSTRUCTURED_API)
10 
11 #ifndef _CAEUNSPATCH_H_
12 #define _CAEUNSPATCH_H_
13 
14 
15 #include "apiGridModel.h"
16 #include "apiPWP.h"
17 #include "CaeUnsGridModel.h"
18 
19 
70 public:
71 
73 
79  PWGM_HDOMAIN_SET_INVALID(h_);
80  }
81 
83 
87  CaeUnsPatch(PWGM_HDOMAIN domain) : h_(domain) {
88  }
89 
91 
95  CaeUnsPatch(const CaeUnsPatch &src) {
96  h_ = src.h_;
97  }
98 
100 
107  moveTo(model, ndx);
108  }
109 
111  virtual ~CaeUnsPatch() {
112  }
113 
117  }
118 
120 
123  PWP_UINT32 index() const {
124  return PWGM_HDOMAIN_ID(h_);
125  }
126 
128 
140  bool condition(PWGM_CONDDATA &data) const {
141  return 0 != PwDomCondition(h_, &data);
142  }
143 
146  bool isValid() const {
147  return PWGM_HDOMAIN_ISVALID(h_);
148  }
149 
151 
157  h_ = rhs.h_;
158  return *this;
159  }
160 
162 
168  h_ = domain;
169  return *this;
170  }
171 
173 
181  h_ = PwModEnumDomains(model, ndx);
182  return *this;
183  }
184 
186 
193  return moveTo(model, 0);
194  }
195 
197 
203  h_ = moveTo(PWGM_HDOMAIN_H(h_), index() + 1);
204  return *this;
205  }
206 
208 
214  CaeUnsPatch& operator++() { // pre incr to next patch
215  return moveNext();
216  }
217 
219 
224  CaeUnsPatch operator++(int) { // post incr to next patch
225  CaeUnsPatch ret = *this;
226  operator++();
227  return ret;
228  }
229 
231 
236  CaeUnsPatch& movePrev() { // move to previous patch
237  h_ = moveTo(PWGM_HDOMAIN_H(h_), index() - 1);
238  return *this;
239  }
240 
242 
248  CaeUnsPatch& operator--() { // pre decr to previous patch
249  return movePrev();
250  }
251 
253 
258  CaeUnsPatch operator--(int) { // post decr to previous patch
259  CaeUnsPatch ret = *this;
260  operator--();
261  return ret;
262  }
263 
265  operator PWGM_HDOMAIN() const {
266  return h_;
267  }
268 
269 protected:
270 
272  virtual PWP_UINT32 elementCountImpl(PWGM_ELEMCOUNTS *pDetails = 0) const {
273  return PwDomElementCount(h_, pDetails);
274  }
275 
276  virtual PWGM_HELEMENT enumElementsImpl(PWP_UINT32 ndx) const {
277  return PwDomEnumElements(h_, ndx);
278  }
280 
281 protected:
282 
284 };
285 
286 #endif // _CAEUNSPATCH_H_
287 
288 #endif // PWGM_HIDE_UNSTRUCTURED_API
The unstructured element group class.
Grid element handle declaration.
Definition: apiGridModel.h:427
CaeUnsPatch(PWGM_HDOMAIN domain)
Domain handle constructor.
Definition: CaeUnsPatch.h:87
#define PWGM_HDOMAIN_ISVALID(h)
returns non-zero value if handle is valid
Definition: apiGridModel.h:374
unsigned int PWP_UINT32
32-bit unsigned integer
Definition: apiPWP.h:210
bool isValid() const
Determines a patch's validity.
Definition: CaeUnsPatch.h:146
CaeUnsGridModel model() const
Gets the unstructured grid model of which this patch is a member.
Definition: CaeUnsPatch.h:115
Pointwise Plugin API (PWP-API)
CaeUnsPatch()
Default constructor.
Definition: CaeUnsPatch.h:78
PWGM_HDOMAIN h_
The bound PWGM_HDOMAIN.
Definition: CaeUnsPatch.h:283
PWGM_HDOMAIN PwModEnumDomains(PWGM_HGRIDMODEL model, PWP_UINT32 ndx)
Sequentially enumerate the model domain elements.
Pointwise Grid Model API Specification (PWGM-API)
PWGM_HELEMENT PwDomEnumElements(PWGM_HDOMAIN domain, PWP_UINT32 ndx)
Sequentially enumerate the domain elements.
virtual PWP_UINT32 elementCountImpl(PWGM_ELEMCOUNTS *pDetails) const =0
Get the number of elements in the group.
The unstructured grid model class.
CaeUnsPatch & operator--()
Prefix decrement to the previous patch in a model.
Definition: CaeUnsPatch.h:248
#define PWGM_HDOMAIN_ID(h)
gets the domain's guid from the handle
Definition: apiGridModel.h:392
CaeUnsPatch & movePrev()
Rebinds an instance to the previous patch in a model.
Definition: CaeUnsPatch.h:236
PWP_BOOL PwDomCondition(PWGM_HDOMAIN domain, PWGM_CONDDATA *pCondData)
Get the domain condition data.
Element count information.
Definition: apiGridModel.h:757
PWP_UINT32 index() const
Get the patch's index.
Definition: CaeUnsPatch.h:123
bool condition(PWGM_CONDDATA &data) const
Get the patch's condition data.
Definition: CaeUnsPatch.h:140
CaeUnsPatch & moveNext()
Rebinds an instance to the next patch in a model.
Definition: CaeUnsPatch.h:202
CaeUnsPatch(const CaeUnsGridModel &model, PWP_UINT32 ndx=0)
Model and patch index constructor.
Definition: CaeUnsPatch.h:106
CaeUnsPatch & operator++()
Prefix increment to the next patch in a model.
Definition: CaeUnsPatch.h:214
CaeUnsPatch & operator=(const CaeUnsPatch &rhs)
Assignment operator.
Definition: CaeUnsPatch.h:156
PWP_UINT32 PwDomElementCount(PWGM_HDOMAIN domain, PWGM_ELEMCOUNTS *pCounts)
Get the number of domain elements.
An opaque handle to a grid domain element.
Definition: apiGridModel.h:372
CaeUnsPatch & moveTo(const CaeUnsGridModel &model, PWP_UINT32 ndx)
Rebinds an instance to a specific model patch.
Definition: CaeUnsPatch.h:180
CaeUnsPatch & moveFirst(const CaeUnsGridModel &model)
Rebinds an instance to the first patch in a model.
Definition: CaeUnsPatch.h:192
CaeUnsPatch(const CaeUnsPatch &src)
Copy constructor.
Definition: CaeUnsPatch.h:95
CaeUnsPatch operator--(int)
Postfix decrement to the previous patch in a model.
Definition: CaeUnsPatch.h:258
Condition descriptor data type.
Definition: apiGridModel.h:644
The unstructured patch class.
Definition: CaeUnsPatch.h:69
#define PWGM_HDOMAIN_H(h)
gets the element's parent PWGM_HGRIDMODEL handle
Definition: apiGridModel.h:390
virtual PWGM_HELEMENT enumElementsImpl(PWP_UINT32 ndx) const =0
Get an element in the group.
CaeUnsPatch operator++(int)
Postfix increment to the next patch in a model.
Definition: CaeUnsPatch.h:224
virtual ~CaeUnsPatch()
Destructor.
Definition: CaeUnsPatch.h:111
CaeUnsPatch & operator=(PWGM_HDOMAIN domain)
Assignment operator.
Definition: CaeUnsPatch.h:167