Commit aa5f5d3d authored by Bob Obara's avatar Bob Obara

ENH: Changing default behavior changes for OperatorViews

Advance Level and Category Filtering is no longer assume to be true when not specified.
parent 0844c2ab
......@@ -113,7 +113,7 @@
VIEW_NAME smtkPolygonEdgeView
<View Type="smtkPolygonEdgeView" Title="Create Polygon Edge">
<View Type="smtkPolygonEdgeView" Title="Create Polygon Edge" FilterByCategory="false">
<Att Type="create edge" />
......@@ -75,7 +75,7 @@
VIEW_NAME smtkPolygonContourView
<View Type="smtkPolygonContourView" Title="Extract Contour Edges">
<View Type="smtkPolygonContourView" Title="Extract Contour Edges" FilterByCategory="false">
<Att Type="extract contours" />
......@@ -94,6 +94,12 @@ bool View::Component::contentsAsVector(std::vector<double>& vec) const
return (vec.size() > 0);
bool View::Component::attribute(const std::string& attname) const
std::string dummy;
return this->attribute(attname, dummy);
bool View::Component::attribute(const std::string& attname, std::string& value) const
std::map<std::string, std::string>::const_iterator it;
......@@ -55,6 +55,9 @@ public:
// Returns true if the component has an attribute called name and will
// set value to the attribute's values. Else it returns false
bool attribute(const std::string& attname, std::string& value) const;
// Description:
// Simply tests to see if the attribute exists
bool attribute(const std::string& attname) const;
// Returns true if the component has an attribute called name and if it has the
// string value of true, t, false, or f (ignoring case). Value will be true if the attribute
......@@ -42,7 +42,8 @@ py::class_< smtk::common::View > pybind11_init_smtk_common_View(py::module &m)
.def("contentsAsInt", &smtk::common::View::Component::contentsAsInt, py::arg("val"))
.def("setContents", &smtk::common::View::Component::setContents, py::arg("c"))
.def("setAttribute", &smtk::common::View::Component::setAttribute, py::arg("attname"), py::arg("value"))
.def("attribute", &smtk::common::View::Component::attribute, py::arg("attname"), py::arg("value"))
.def("attribute", (bool (smtk::common::View::Component::*)(::std::string const &, ::std::string &) const) &smtk::common::View::Component::attribute, py::arg("attname"), py::arg("value"))
.def("attribute", (bool (smtk::common::View::Component::*)(::std::string const &) const) &smtk::common::View::Component::attribute, py::arg("attname"))
.def("attributeAsBool", (bool (smtk::common::View::Component::*)(::std::string const &, bool &) const) &smtk::common::View::Component::attributeAsBool, py::arg("attname"), py::arg("value"))
.def("attributeAsBool", (bool (smtk::common::View::Component::*)(::std::string const &) const) &smtk::common::View::Component::attributeAsBool, py::arg("attname"))
.def("attributes", &smtk::common::View::Component::attributes)
......@@ -71,6 +71,16 @@ qtOperatorView::qtOperatorView(const OperatorViewInfo& info)
// We need to remove the TopLevel attribute (if there is one)
// The default top-level behavior is that filter by category and advance level is on by default.
// For Operator View they need to be explicilty set to turn them on
if (!view->details().attribute("FilterByAdvanceLevel"))
view->details().setAttribute("FilterByAdvanceLevel", "false");
if (!view->details().attribute("FilterByCategory"))
view->details().setAttribute("FilterByCategory", "false");
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment