9 #ifndef CMZN_NODE_HPP__
10 #define CMZN_NODE_HPP__
12 #include "zinc/node.h"
13 #include "zinc/field.hpp"
14 #include "zinc/timesequence.hpp"
50 explicit Node(cmzn_node_id node_id) : id(node_id)
54 id(cmzn_node_access(node.id))
108 cmzn_node_id temp_id = cmzn_node_access(node.id);
111 cmzn_node_destroy(&
id);
121 cmzn_node_destroy(&
id);
154 return cmzn_node_get_identifier(
id);
167 return cmzn_node_set_identifier(
id, identifier);
181 inline bool operator==(
const Node& a,
const Node& b)
183 return a.getId() == b.getId();
197 cmzn_nodetemplate_id id;
205 explicit Nodetemplate(cmzn_nodetemplate_id node_template_id) :
210 id(cmzn_nodetemplate_access(nodeTemplate.id))
215 cmzn_nodetemplate_id temp_id = cmzn_nodetemplate_access(nodeTemplate.id);
218 cmzn_nodetemplate_destroy(&
id);
228 cmzn_nodetemplate_destroy(&
id);
264 return cmzn_nodetemplate_define_field(
id, field.
getId());
281 return cmzn_nodetemplate_define_field_from_node(
id, field.
getId(), node.
getId());
312 return cmzn_nodetemplate_set_timesequence(
id, field.
getId(), timesequence.
getId());
331 return cmzn_nodetemplate_get_value_number_of_versions(
id, field.
getId(),
332 componentNumber,
static_cast<cmzn_node_value_label
>(valueLabel));
361 return cmzn_nodetemplate_set_value_number_of_versions(
id, field.
getId(),
362 componentNumber,
static_cast<cmzn_node_value_label
>(valueLabel), numberOfVersions);
374 return cmzn_nodetemplate_remove_field(
id, field.
getId());
386 return cmzn_nodetemplate_undefine_field(
id, field.
getId());
399 cmzn_nodeiterator_id id;
407 explicit Nodeiterator(cmzn_nodeiterator_id node_iterator_id) :
412 id(cmzn_nodeiterator_access(nodeIterator.id))
417 cmzn_nodeiterator_id temp_id = cmzn_nodeiterator_access(nodeIterator.id);
420 cmzn_nodeiterator_destroy(&
id);
430 cmzn_nodeiterator_destroy(&
id);
453 return Node(cmzn_nodeiterator_next(
id));
474 explicit Nodeset(cmzn_nodeset_id nodeset_id) : id(nodeset_id)
478 id(cmzn_nodeset_access(nodeset.id))
483 cmzn_nodeset_id temp_id = cmzn_nodeset_access(nodeset.id);
486 cmzn_nodeset_destroy(&
id);
496 cmzn_nodeset_destroy(&
id);
537 return cmzn_nodeset_contains_node(
id, node.
getId());
549 return Nodetemplate(cmzn_nodeset_create_nodetemplate(
id));
564 return Node(cmzn_nodeset_create_node(
id, identifier, nodeTemplate.
getId()));
579 return Nodeiterator(cmzn_nodeset_create_nodeiterator(
id));
590 return cmzn_nodeset_destroy_all_nodes(
id);
602 return cmzn_nodeset_destroy_node(
id, node.
getId());
618 return cmzn_nodeset_destroy_nodes_conditional(
id, conditionalField.
getId());
629 return Node(cmzn_nodeset_find_node_by_identifier(
id, identifier));
647 return Nodeset(cmzn_nodeset_get_master_nodeset(
id));
659 return cmzn_nodeset_get_name(
id);
669 return cmzn_nodeset_get_size(
id);
674 inline bool operator==(
const Nodeset& a,
const Nodeset& b)
676 return cmzn_nodeset_match(a.getId(), b.getId());
681 return Nodeset(cmzn_node_get_nodeset(
id));
695 explicit NodesetGroup(cmzn_nodeset_group_id nodeset_id) :
Nodeset(reinterpret_cast<cmzn_nodeset_id>(nodeset_id))
708 return (cmzn_nodeset_group_id)(id);
721 return cmzn_nodeset_group_add_node(
722 reinterpret_cast<cmzn_nodeset_group_id>(
id), node.
getId());
735 return cmzn_nodeset_group_add_nodes_conditional(
736 reinterpret_cast<cmzn_nodeset_group_id>(
id), conditionalField.
getId());
746 return cmzn_nodeset_group_remove_all_nodes(
747 reinterpret_cast<cmzn_nodeset_group_id>(
id));
760 return cmzn_nodeset_group_remove_node(reinterpret_cast<cmzn_nodeset_group_id>(
id),
775 return cmzn_nodeset_group_remove_nodes_conditional(
776 reinterpret_cast<cmzn_nodeset_group_id>(
id), conditionalField.
getId());
795 cmzn_nodesetchanges_id id;
803 explicit Nodesetchanges(cmzn_nodesetchanges_id nodesetchanges_id) :
804 id(nodesetchanges_id)
808 id(cmzn_nodesetchanges_access(nodesetchanges.id))
813 cmzn_nodesetchanges_id temp_id = cmzn_nodesetchanges_access(nodesetchanges.id);
815 cmzn_nodesetchanges_destroy(&
id);
823 cmzn_nodesetchanges_destroy(&
id);
844 return cmzn_nodesetchanges_get_node_change_flags(
id, node.
getId());
855 return cmzn_nodesetchanges_get_number_of_changes(
id);
865 return cmzn_nodesetchanges_get_summary_node_change_flags(
id);
869 inline int Node::merge(
const Nodetemplate& nodeTemplate)
871 return cmzn_node_merge(
id, nodeTemplate.getId());
An iterator for looping through all the nodes in a nodeset.
Definition: node.hpp:395
bool isValid() const
Definition: node.hpp:831
Object describing changes to a nodeset in a fieldmoduleevent.
Definition: node.hpp:791
bool isValid() const
Definition: node.hpp:505
int setTimesequence(const Field &field, const Timesequence ×equence)
Definition: node.hpp:310
int addNode(const Node &node)
Definition: node.hpp:719
cmzn_nodetemplate_id getId() const
Definition: node.hpp:247
int setValueNumberOfVersions(const Field &field, int componentNumber, Node::ValueLabel valueLabel, int numberOfVersions)
Definition: node.hpp:358
A description of field parameters to define at a node.
Definition: node.hpp:193
int removeNode(const Node &node)
Definition: node.hpp:758
ValueLabel
Definition: node.hpp:84
Base field type: an abstraction of a mathematical field.
Definition: field.hpp:49
int removeNodesConditional(const Field &conditionalField)
Definition: node.hpp:773
Node::ChangeFlags getNodeChangeFlags(const Node &node)
Definition: node.hpp:842
int getIdentifier()
Definition: node.hpp:152
A subset of a master nodeset.
Definition: node.hpp:689
cmzn_nodeset_id getId() const
Definition: node.hpp:515
int destroyAllNodes()
Definition: node.hpp:588
Node next()
Definition: node.hpp:451
int removeField(const Field &field)
Definition: node.hpp:372
bool isValid() const
Definition: node.hpp:237
cmzn_nodeset_group_id getId() const
Definition: node.hpp:706
NodesetGroup castGroup()
Definition: node.hpp:781
Node::ChangeFlags getSummaryNodeChangeFlags()
Definition: node.hpp:863
ChangeFlag
Definition: node.hpp:60
Node findNodeByIdentifier(int identifier)
Definition: node.hpp:627
int undefineField(const Field &field)
Definition: node.hpp:384
Nodetemplate createNodetemplate()
Definition: node.hpp:547
int getValueNumberOfVersions(const Field &field, int componentNumber, Node::ValueLabel valueLabel)
Definition: node.hpp:328
cmzn_field_id getId() const
Definition: field.hpp:101
Nodeiterator createNodeiterator()
Definition: node.hpp:577
int destroyNode(const Node &node)
Definition: node.hpp:600
int setIdentifier(int identifier)
Definition: node.hpp:165
Timesequence getTimesequence(const Field &field)
Definition: node.hpp:291
bool isValid() const
Definition: node.hpp:439
Nodeset getMasterNodeset()
Definition: node.hpp:645
Nodeset getNodeset() const
Definition: node.hpp:679
int getSize()
Definition: node.hpp:667
char * getName()
Definition: node.hpp:657
cmzn_node_id getId() const
Definition: node.hpp:140
int getNumberOfChanges()
Definition: node.hpp:853
int defineField(const Field &field)
Definition: node.hpp:262
Container/manager of fields and domains within a region.
Definition: fieldmodule.hpp:133
bool isValid() const
Definition: node.hpp:130
A non-decreasing list of times at which nodal parameters can be stored.
Definition: timesequence.hpp:35
Node createNode(int identifier, const Nodetemplate &nodeTemplate)
Definition: node.hpp:562
cmzn_timesequence_id getId() const
Definition: timesequence.hpp:88
int ChangeFlags
Definition: node.hpp:79
bool containsNode(const Node &node)
Definition: node.hpp:535
Point object used to represent finite element nodes.
Definition: node.hpp:38
int removeAllNodes()
Definition: node.hpp:744
int destroyNodesConditional(const Field &conditionalField)
Definition: node.hpp:616
int addNodesConditional(const Field &conditionalField)
Definition: node.hpp:733
int defineFieldFromNode(const Field &field, const Node &node)
Definition: node.hpp:279
A set of nodes or points.
Definition: node.hpp:462
Fieldmodule getFieldmodule() const
Definition: fieldmodule.hpp:1734