Go to the documentation of this file.
5 #ifndef CNOID_BASE_PUT_PROPERTY_FUNCTION_H
6 #define CNOID_BASE_PUT_PROPERTY_FUNCTION_H
8 #include <cnoid/Selection>
10 #include "exportdecl.h"
16 std::string filename_;
17 std::string baseDirectory_;
18 std::vector<std::string> filters_;
19 bool isFullpathDisplayMode_ =
false;
20 bool isExistingFileMode_ =
true;
21 bool isExtensionRemovalModeForFileDialogSelection_ =
false;
29 const std::string&
filename()
const {
return filename_; };
33 isExtensionRemovalModeForFileDialogSelection_ = on; }
35 return isExtensionRemovalModeForFileDialogSelection_; }
40 const std::vector<std::string>&
filters()
const {
return filters_; }
64 virtual void operator()(
const std::string& name,
bool value) = 0;
65 virtual void operator()(
const std::string& name,
bool value,
66 const std::function<
bool(
bool)>& changeFunc) = 0;
68 virtual void operator()(
const std::string& name,
int value) = 0;
69 virtual void operator()(
const std::string& name,
int value,
70 const std::function<
bool(
int)>& changeFunc) = 0;
72 virtual void operator()(
const std::string& name,
double value) = 0;
73 virtual void operator()(
const std::string& name,
double value,
74 const std::function<
bool(
double)>& changeFunc) = 0;
76 virtual void operator()(
const std::string& name,
const std::string& value) = 0;
77 virtual void operator()(
const std::string& name,
const std::string& value,
78 const std::function<
bool(
const std::string&)>& changeFunc) = 0;
80 virtual void operator()(
const std::string& name,
const Selection& selection) = 0;
81 virtual void operator()(
const std::string& name,
const Selection& selection,
82 const std::function<
bool(
int which)>& changeFunc) = 0;
84 virtual void operator()(
const std::string& name,
const FilePathProperty& filepath) = 0;
85 virtual void operator()(
const std::string& name,
const FilePathProperty& filepath,
86 const std::function<
bool(
const std::string&)>& changeFunc) = 0;
90 template <
class ValueType>
109 selection.select(value);
114 template<
class ValueType>
Definition: Selection.h:15
ChangeProperty(Selection &variable)
Definition: PutPropertyFunction.h:107
void setFullpathDisplayMode(bool on)
Definition: PutPropertyFunction.h:44
Definition: PutPropertyFunction.h:51
void setFilters(const std::vector< std::string > &filters)
Definition: PutPropertyFunction.h:41
FilePathProperty()
Definition: PutPropertyFunction.h:24
bool operator()(const ValueType &value)
Definition: PutPropertyFunction.h:96
ChangeProperty(ValueType &variable)
Definition: PutPropertyFunction.h:95
const std::string & filename() const
Definition: PutPropertyFunction.h:29
bool operator()(int value)
Definition: PutPropertyFunction.h:108
void setBaseDirectory(const std::string &dir)
Definition: PutPropertyFunction.h:38
void setExtensionRemovalModeForFileDialogSelection(bool on)
Definition: PutPropertyFunction.h:32
FilePathProperty(const std::string &filename)
Definition: PutPropertyFunction.h:25
Definition: PutPropertyFunction.h:91
bool isFullpathDisplayMode() const
Definition: PutPropertyFunction.h:43
Definition: AbstractSceneLoader.h:11
bool isExtensionRemovalModeForFileDialogSelection() const
Definition: PutPropertyFunction.h:34
const std::vector< std::string > & filters() const
Definition: PutPropertyFunction.h:40
Definition: PutPropertyFunction.h:14
const std::string & baseDirectory() const
Definition: PutPropertyFunction.h:37
FilePathProperty(const std::string &filename, const std::vector< std::string > &filters)
Definition: PutPropertyFunction.h:26
ChangeProperty< ValueType > changeProperty(ValueType &variable)
Definition: PutPropertyFunction.h:115
void setFilename(const std::string &filename)
Definition: PutPropertyFunction.h:30
void setExistingFileMode(bool on)
Definition: PutPropertyFunction.h:47
bool isExistingFileMode() const
Definition: PutPropertyFunction.h:46