OpenCMISS-Zinc C++ API Documentation
elementfieldtemplate.hpp
Go to the documentation of this file.
1 
4 /* OpenCMISS-Zinc Library
5 *
6 * This Source Code Form is subject to the terms of the Mozilla Public
7 * License, v. 2.0. If a copy of the MPL was not distributed with this
8 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
9 
10 #ifndef CMZN_ELEMENTFIELDTEMPLATE_HPP__
11 #define CMZN_ELEMENTFIELDTEMPLATE_HPP__
12 
13 #include "opencmiss/zinc/elementfieldtemplate.h"
14 #include "opencmiss/zinc/elementbasis.hpp"
15 #include "opencmiss/zinc/node.hpp"
16 
17 namespace OpenCMISS
18 {
19 namespace Zinc
20 {
21 
40 {
41 private:
42 
43  cmzn_elementfieldtemplate_id id;
44 
45 public:
46 
47  Elementfieldtemplate() : id(0)
48  { }
49 
50  // takes ownership of C handle, responsibility for destroying it
51  explicit Elementfieldtemplate(cmzn_elementfieldtemplate_id elementfieldtemplate_id) :
52  id(elementfieldtemplate_id)
53  { }
54 
55  Elementfieldtemplate(const Elementfieldtemplate& elementfieldtemplate) :
56  id(cmzn_elementfieldtemplate_access(elementfieldtemplate.id))
57  { }
58 
59  Elementfieldtemplate& operator=(const Elementfieldtemplate& elementfieldemplate)
60  {
61  cmzn_elementfieldtemplate_id temp_id = cmzn_elementfieldtemplate_access(elementfieldemplate.id);
62  if (0 != this->id)
63  cmzn_elementfieldtemplate_destroy(&(this->id));
64  this->id = temp_id;
65  return *this;
66  }
67 
69  {
70  cmzn_elementfieldtemplate_destroy(&(this->id));
71  }
72 
77  {
78  PARAMETER_MAPPING_MODE_INVALID = CMZN_ELEMENTFIELDTEMPLATE_PARAMETER_MAPPING_MODE_INVALID,
80  PARAMETER_MAPPING_MODE_ELEMENT = CMZN_ELEMENTFIELDTEMPLATE_PARAMETER_MAPPING_MODE_ELEMENT,
82  PARAMETER_MAPPING_MODE_FIELD = CMZN_ELEMENTFIELDTEMPLATE_PARAMETER_MAPPING_MODE_FIELD,
84  PARAMETER_MAPPING_MODE_NODE = CMZN_ELEMENTFIELDTEMPLATE_PARAMETER_MAPPING_MODE_NODE
86  };
87 
100  {
101  SCALE_FACTOR_TYPE_INVALID = CMZN_ELEMENTFIELDTEMPLATE_SCALE_FACTOR_TYPE_INVALID,
103  SCALE_FACTOR_TYPE_ELEMENT_GENERAL = CMZN_ELEMENTFIELDTEMPLATE_SCALE_FACTOR_TYPE_ELEMENT_GENERAL,
105  SCALE_FACTOR_TYPE_ELEMENT_PATCH = CMZN_ELEMENTFIELDTEMPLATE_SCALE_FACTOR_TYPE_ELEMENT_PATCH,
107  SCALE_FACTOR_TYPE_GLOBAL_GENERAL = CMZN_ELEMENTFIELDTEMPLATE_SCALE_FACTOR_TYPE_GLOBAL_GENERAL,
109  SCALE_FACTOR_TYPE_GLOBAL_PATCH = CMZN_ELEMENTFIELDTEMPLATE_SCALE_FACTOR_TYPE_GLOBAL_PATCH,
111  SCALE_FACTOR_TYPE_NODE_GENERAL = CMZN_ELEMENTFIELDTEMPLATE_SCALE_FACTOR_TYPE_NODE_GENERAL,
113  SCALE_FACTOR_TYPE_NODE_PATCH = CMZN_ELEMENTFIELDTEMPLATE_SCALE_FACTOR_TYPE_NODE_PATCH
115  };
116 
122  bool isValid() const
123  {
124  return (0 != this->id);
125  }
126 
132  cmzn_elementfieldtemplate_id getId() const
133  {
134  return this->id;
135  }
136 
145  {
146  return Elementbasis(cmzn_elementfieldtemplate_get_elementbasis(this->id));
147  }
148 
156  int getFunctionNumberOfTerms(int functionNumber) const
157  {
158  return cmzn_elementfieldtemplate_get_function_number_of_terms(this->id, functionNumber);
159  }
160 
173  int setFunctionNumberOfTerms(int functionNumber, int newNumberOfTerms)
174  {
175  return cmzn_elementfieldtemplate_set_function_number_of_terms(this->id, functionNumber, newNumberOfTerms);
176  }
177 
184  {
185  return cmzn_elementfieldtemplate_get_number_of_functions(this->id);
186  }
187 
194  {
195  return cmzn_elementfieldtemplate_get_number_of_local_nodes(this->id);
196  }
197 
206  int setNumberOfLocalNodes(int number)
207  {
208  return cmzn_elementfieldtemplate_set_number_of_local_nodes(this->id, number);
209  }
210 
217  {
218  return cmzn_elementfieldtemplate_get_number_of_local_scale_factors(this->id);
219  }
220 
231  {
232  return cmzn_elementfieldtemplate_set_number_of_local_scale_factors(this->id, number);
233  }
234 
241  {
242  return static_cast<ParameterMappingMode>(cmzn_elementfieldtemplate_get_parameter_mapping_mode(this->id));
243  }
244 
257  {
258  return cmzn_elementfieldtemplate_set_parameter_mapping_mode(this->id,
259  static_cast<cmzn_elementfieldtemplate_parameter_mapping_mode>(mode));
260  }
261 
271  int getScaleFactorIdentifier(int localScaleFactorIndex) const
272  {
273  return cmzn_elementfieldtemplate_get_scale_factor_identifier(this->id, localScaleFactorIndex);
274  }
275 
300  int setScaleFactorIdentifier(int localScaleFactorIndex, int identifier)
301  {
302  return cmzn_elementfieldtemplate_set_scale_factor_identifier(this->id, localScaleFactorIndex, identifier);
303  }
304 
313  ScaleFactorType getScaleFactorType(int localScaleFactorIndex) const
314  {
315  return static_cast<ScaleFactorType>(
316  cmzn_elementfieldtemplate_get_scale_factor_type(this->id, localScaleFactorIndex));
317  }
318 
331  int setScaleFactorType(int localScaleFactorIndex, ScaleFactorType type)
332  {
333  return cmzn_elementfieldtemplate_set_scale_factor_type(this->id,
334  localScaleFactorIndex, static_cast<cmzn_elementfieldtemplate_scale_factor_type>(type));
335  }
336 
346  int getTermLocalNodeIndex(int functionNumber, int term) const
347  {
348  return cmzn_elementfieldtemplate_get_term_local_node_index(this->id, functionNumber, term);
349  }
350 
359  Node::ValueLabel getTermNodeValueLabel(int functionNumber, int term) const
360  {
361  return static_cast<Node::ValueLabel>(cmzn_elementfieldtemplate_get_term_node_value_label(this->id, functionNumber, term));
362  }
363 
372  int getTermNodeVersion(int functionNumber, int term) const
373  {
374  return cmzn_elementfieldtemplate_get_term_node_version(this->id, functionNumber, term);
375  }
376 
389  int setTermNodeParameter(int functionNumber, int term, int localNodeIndex, Node::ValueLabel nodeValueLabel, int version)
390  {
391  return cmzn_elementfieldtemplate_set_term_node_parameter(this->id, functionNumber, term,
392  localNodeIndex, static_cast<cmzn_node_value_label>(nodeValueLabel), version);
393  }
394 
407  int getTermScaling(int functionNumber, int term, int indexesCount, int *indexesOut) const
408  {
409  return cmzn_elementfieldtemplate_get_term_scaling(this->id, functionNumber, term, indexesCount, indexesOut);
410  }
411 
426  int setTermScaling(int functionNumber, int term, int indexesCount, const int *indexesIn)
427  {
428  return cmzn_elementfieldtemplate_set_term_scaling(this->id, functionNumber, term, indexesCount, indexesIn);
429  }
430 
442  bool validate()
443  {
444  return cmzn_elementfieldtemplate_validate(this->id);
445  }
446 
447 };
448 
449 } // namespace Zinc
450 }
451 
452 #endif /* CMZN_ELEMENTFIELDTEMPLATE_HPP__ */
int getTermScaling(int functionNumber, int term, int indexesCount, int *indexesOut) const
Definition: elementfieldtemplate.hpp:407
int getNumberOfLocalNodes() const
Definition: elementfieldtemplate.hpp:193
int setNumberOfLocalNodes(int number)
Definition: elementfieldtemplate.hpp:206
int setTermNodeParameter(int functionNumber, int term, int localNodeIndex, Node::ValueLabel nodeValueLabel, int version)
Definition: elementfieldtemplate.hpp:389
ValueLabel
Definition: node.hpp:80
A set of basis functions that can apply over an element of a given dimension.
Definition: elementbasis.hpp:28
int setScaleFactorIdentifier(int localScaleFactorIndex, int identifier)
Definition: elementfieldtemplate.hpp:300
ScaleFactorType getScaleFactorType(int localScaleFactorIndex) const
Definition: elementfieldtemplate.hpp:313
Node::ValueLabel getTermNodeValueLabel(int functionNumber, int term) const
Definition: elementfieldtemplate.hpp:359
Elementbasis getElementbasis() const
Definition: elementfieldtemplate.hpp:144
int getNumberOfLocalScaleFactors() const
Definition: elementfieldtemplate.hpp:216
int getFunctionNumberOfTerms(int functionNumber) const
Definition: elementfieldtemplate.hpp:156
int setScaleFactorType(int localScaleFactorIndex, ScaleFactorType type)
Definition: elementfieldtemplate.hpp:331
int getNumberOfFunctions() const
Definition: elementfieldtemplate.hpp:183
int setFunctionNumberOfTerms(int functionNumber, int newNumberOfTerms)
Definition: elementfieldtemplate.hpp:173
int getTermNodeVersion(int functionNumber, int term) const
Definition: elementfieldtemplate.hpp:372
int setTermScaling(int functionNumber, int term, int indexesCount, const int *indexesIn)
Definition: elementfieldtemplate.hpp:426
int setNumberOfLocalScaleFactors(int number)
Definition: elementfieldtemplate.hpp:230
ParameterMappingMode
Definition: elementfieldtemplate.hpp:76
ParameterMappingMode getParameterMappingMode() const
Definition: elementfieldtemplate.hpp:240
bool isValid() const
Definition: elementfieldtemplate.hpp:122
int getScaleFactorIdentifier(int localScaleFactorIndex) const
Definition: elementfieldtemplate.hpp:271
int getTermLocalNodeIndex(int functionNumber, int term) const
Definition: elementfieldtemplate.hpp:346
The OpenCMISS namespace.
Definition: context.hpp:20
bool validate()
Definition: elementfieldtemplate.hpp:442
ScaleFactorType
Definition: elementfieldtemplate.hpp:99
cmzn_elementfieldtemplate_id getId() const
Definition: elementfieldtemplate.hpp:132
A template defining field parameter mapping and interpolation over an element chart.
Definition: elementfieldtemplate.hpp:39
int setParameterMappingMode(ParameterMappingMode mode)
Definition: elementfieldtemplate.hpp:256