OpenCMISS-Zinc C++ API Documentation
fieldconditional.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_FIELDCONDITIONAL_HPP__
10 #define CMZN_FIELDCONDITIONAL_HPP__
11 
12 #include "opencmiss/zinc/fieldconditional.h"
13 #include "opencmiss/zinc/field.hpp"
14 #include "opencmiss/zinc/fieldmodule.hpp"
15 
16 namespace OpenCMISS
17 {
18 namespace Zinc
19 {
20 class FieldIf : public Field
31 {
32 private:
33  // takes ownership of C handle, responsibility for destroying it
34  explicit FieldIf(cmzn_field_id field_id) : Field(field_id)
35  { }
36 
37  friend FieldIf Fieldmodule::createFieldIf(const Field& sourceField1, const Field& sourceField2, const Field& sourceField3);
38 
39 public:
40 
41  FieldIf() : Field(0)
42  { }
43 
44 };
45 
46 inline FieldIf Fieldmodule::createFieldIf(const Field& sourceField1, const Field& sourceField2, const Field& sourceField3)
47 {
48  return FieldIf(cmzn_fieldmodule_create_field_if(id,
49  sourceField1.getId(), sourceField2.getId(), sourceField3.getId()));
50 }
51 
52 } // namespace Zinc
53 }
54 
55 #endif
Base field type: an abstraction of a mathematical field.
Definition: field.hpp:51
A conditional field with the same number of components as each of the source_fields.
Definition: fieldconditional.hpp:30
cmzn_field_id getId() const
Definition: field.hpp:103
The OpenCMISS namespace.
Definition: context.hpp:20
FieldIf createFieldIf(const Field &sourceField1, const Field &sourceField2, const Field &sourceField3)
Definition: fieldconditional.hpp:46