Go to the documentation of this file. 1 #ifndef CNOID_MANIPULATOR_PLUGIN_MPR_PROGRAM_H
2 #define CNOID_MANIPULATOR_PLUGIN_MPR_PROGRAM_H
4 #include <cnoid/ClonableReferenced>
5 #include <cnoid/Signal>
9 #include "exportdecl.h"
15 class MprPositionList;
17 class MprStructuredStatement;
18 class PositionTagGroup;
32 return static_cast<MprProgram*
>(doClone(
nullptr));
35 return static_cast<MprProgram*
>(doClone(&cloneMap));
38 const std::string& name()
const;
39 void setName(
const std::string& name);
41 bool empty()
const {
return statements_.empty(); }
44 iterator insert(iterator pos,
MprStatement* statement,
bool doNotify =
true);
45 iterator append(
MprStatement* statement,
bool doNotify =
true);
46 iterator remove(iterator pos,
bool doNotify =
true);
47 bool remove(
MprStatement* statement,
bool doNotify =
true);
50 void clearStatements();
57 void setLocalPositionListEnabled(
bool on);
61 void removeUnreferencedPositions();
67 void notifyStatementUpdate(
MprStatement* statement)
const;
70 bool isTopLevelProgram()
const;
71 bool isSubProgram()
const;
74 void traverseStatements(std::function<
void(
MprStatement* statement)> callback);
80 bool traverseStatements(std::function<
bool(
MprStatement* statement)> callback);
82 void renumberPositionIds();
87 bool load(
const std::string& filename, std::ostream& os);
88 bool save(
const std::string& filename);
98 StatementContainer statements_;
99 bool hasLocalPositionList_;
100 bool isEditingEnabled_;
bool hasLocalPositionList() const
Definition: MprProgram.h:58
Definition: ValueTree.h:253
Definition: MprStructuredStatement.h:10
const_iterator end() const
Definition: MprProgram.h:55
Listing * write(Mapping *mapping, const std::string &key, const Eigen::MatrixBase< Derived > &x)
Definition: EigenArchive.h:145
int numStatements() const
Definition: MprProgram.h:42
MprProgram * clone() const
Definition: MprProgram.h:31
bool read(const Mapping *mapping, const std::string &key, Eigen::MatrixBase< Derived > &x)
Definition: EigenArchive.h:43
void setEditingEnabled(bool on)
Definition: MprProgram.h:85
const_iterator begin() const
Definition: MprProgram.h:53
ref_ptr< MprProgram > MprProgramPtr
Definition: MprProgram.h:110
iterator end()
Definition: MprProgram.h:54
MprProgram * clone(CloneMap &cloneMap) const
Definition: MprProgram.h:34
Definition: AbstractSceneLoader.h:11
Definition: ClonableReferenced.h:10
Definition: CloneMap.h:13
Definition: MprStatement.h:16
Definition: Referenced.h:54
std::deque< ref_ptr< MprStatement > > StatementContainer
Definition: MprProgram.h:24
Definition: MprProgram.h:21
StatementContainer::const_iterator const_iterator
Definition: MprProgram.h:26
Definition: MprPositionList.h:14
iterator begin()
Definition: MprProgram.h:52
bool empty() const
Definition: MprProgram.h:41
StatementContainer::iterator iterator
Definition: MprProgram.h:25
bool isEditingEnabled() const
Definition: MprProgram.h:84