X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCanvas%2Fproperty_helper.hxx;h=92e556afcfd617b7d90214d0d64af325103386e6;hb=f7878cfd4dc90285c9cdda2c347425d07b8528aa;hp=8e14e554809995d368c3a60feea0d6e3c5fc029a;hpb=df768766d9abaa46bd73c2f39e6d205408192ed7;p=flightgear.git diff --git a/src/Canvas/property_helper.hxx b/src/Canvas/property_helper.hxx index 8e14e5548..92e556afc 100644 --- a/src/Canvas/property_helper.hxx +++ b/src/Canvas/property_helper.hxx @@ -60,12 +60,26 @@ namespace canvas return values; } + /** + * Split a string by a delimter and convert the values to float + * + * TODO do we need other types than float? + */ + std::vector splitAndConvert(const char del[], const std::string& str); + + /** + * Parse a (CSS) color + */ + osg::Vec4 parseColor(std::string str); + /** * @param name Name of color node * @param parent Parent for color channel nodes * @param nodes Vector to push color nodes into * @param def Default color * + * @deprecated Use only a single property instead and parse with #parseColor + * * * def[0] or existing value * def[1] or existing value @@ -76,7 +90,19 @@ namespace canvas void linkColorNodes( const char* name, SGPropertyNode* parent, std::vector& nodes, - const osg::Vec4& def = osg::Vec4(0,0,0,0) ); + const osg::Vec4& def = osg::Vec4(0,0,0,1) ); + + /** + * Trigger a childAdded and valueChanged event for every child of node + * (Unlimited depth) and node itself. + */ + void triggerChangeRecursive(SGPropertyNode* node); + + /** + * Trigger a childRemoved event for every child of node (Unlimited depth) and + * node itself. + */ + void triggerRemoveRecursive(SGPropertyNode* node); } // namespace canvas