OpenCMISS-Zinc C++ API Documentation
fieldconstant.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 #ifndef CMZN_FIELDCONSTANT_HPP__
10 #define CMZN_FIELDCONSTANT_HPP__
11 
12 #include "opencmiss/zinc/fieldconstant.h"
13 #include "opencmiss/zinc/field.hpp"
14 #include "opencmiss/zinc/fieldmodule.hpp"
15 
16 namespace OpenCMISS
17 {
18 namespace Zinc
19 {
20 class FieldConstant : public Field
28 {
29 private:
30  // takes ownership of C handle, responsibility for destroying it
31  explicit FieldConstant(cmzn_field_id field_id) : Field(field_id)
32  { }
33 
34  friend FieldConstant Fieldmodule::createFieldConstant(int valuesCount, const double *valuesIn);
35 
36 public:
37 
38  FieldConstant() : Field(0)
39  { }
40 
41 };
42 class FieldStringConstant : public Field
51 {
52 private:
53  // takes ownership of C handle, responsibility for destroying it
54  explicit FieldStringConstant(cmzn_field_id field_id) : Field(field_id)
55  { }
56 
57  friend FieldStringConstant Fieldmodule::createFieldStringConstant(const char *stringConstant);
58 
59 public:
60 
61  FieldStringConstant() : Field(0)
62  { }
63 
64 };
65 
66 inline FieldConstant Fieldmodule::createFieldConstant(int valuesCount, const double *valuesIn)
67 {
68  return FieldConstant(cmzn_fieldmodule_create_field_constant(id,
69  valuesCount, valuesIn));
70 }
71 
73 {
74  return FieldStringConstant(cmzn_fieldmodule_create_field_string_constant(id,
75  stringConstant));
76 }
77 
78 } // namespace Zinc
79 }
80 
81 #endif
FieldStringConstant createFieldStringConstant(const char *stringConstant)
Definition: fieldconstant.hpp:72
FieldConstant createFieldConstant(int valuesCount, const double *valuesIn)
Definition: fieldconstant.hpp:66
A field with the components specified in the array values.
Definition: fieldconstant.hpp:27
The OpenCMISS namespace.
Definition: context.hpp:20
A string constant field with the supplied string value in <string_constant>.
Definition: fieldconstant.hpp:50