11 #ifndef __SOP_LightLink__
12 #define __SOP_LightLink__
47 typedef std::pair<std::string, std::string>
SetOp;
48 typedef std::pair<std::string, VisibleInfo>
VisibleOp;
65 VISIBLE_UNCHANGED = -1,
74 COMMON_MATERIAL = 0x02,
77 COMMON_ALL = (COMMON_MATERIAL|COMMON_LOD|COMMON_EXPR)
84 , myVisible(VISIBLE_UNCHANGED)
89 , myCommonKids(COMMON_ALL)
102 if (it == myKids.end())
113 if (it == myKids.end())
119 return myKids.size();
126 myExpr = theAsterisk;
132 it->second->clearSubtree();
138 it->second->setMaterial(m);
143 myExprPtr.reset(NULL);
146 it->second->setExpr(expr);
152 updateTagExpression();
154 it->second->clearTagExpressions();
158 createTagExpression(mgr);
160 myExprPtr = myExprPtr->addTags(tags);
162 it->second->addTag(mgr, tags);
166 createTagExpression(mgr);
168 myExprPtr = myExprPtr->rmTags(tags);
170 it->second->rmTag(mgr, tags);
174 myVisible = visibility;
176 it->second->setVisible(visibility);
182 it->second->setViewportLOD(lod);
209 it != myKids.end(); ++it)
210 it->second->dump(indent+1);
221 myExprPtr.reset(NULL);
224 void updateTagExpression()
229 myExprPtr->getExpressionString(expr);
231 myExprPtr.reset(NULL);
235 void dumpNode(
int indent)
const;
241 myCommonKids = COMMON_ALL;
242 for (NodeSet::iterator it=myKids.begin(); it != myKids.end(); ++it)
245 myCommonKids &= it->second->pruneBranches();
247 for (NodeSet::iterator it=myKids.begin(); it != myKids.end(); ++it)
249 if (it->second->myMaterial != kid->myMaterial)
250 myCommonKids &= ~COMMON_MATERIAL;
251 if (it->second->myVisible != kid->myVisible ||
252 it->second->myViewportLOD != kid->myViewportLOD)
254 myCommonKids &= ~COMMON_LOD;
256 else if (it->second->myExpr != kid->myExpr)
258 myCommonKids &= ~COMMON_EXPR;
263 if (myCommonKids && kid)
266 if (myCommonKids & COMMON_LOD)
268 myVisible = kid->myVisible;
269 myViewportLOD = kid->myViewportLOD;
271 if (myCommonKids & COMMON_EXPR)
272 myExpr = kid->myExpr;
273 if (myCommonKids & COMMON_MATERIAL)
274 myMaterial = kid->myMaterial;
294 void addPath(
const char *
path);
300 bool setVisible(
const char *
path,
int visible);
345 void dump(
const char *msg);
356 Node *findNode(
const char *
path,
bool create)
const;
GT_API const UT_StringHolder selection
GLsizei const GLchar *const * string
GLsizei const GLchar *const * path
UT_Map< std::string, Node * > NodeSet
void setExpr(const std::string &expr)
void dump(int indent) const
void clearValues()
Restore tree to default values.
void clearTagExpressions()
Node(const std::string &name, Node *parent)
VisibleInfo(int v, GEO_ViewportLOD l)
void setMaterial(const std::string &m)
void setVisible(int visibility)
void setViewportLOD(GEO_ViewportLOD lod)
void addTag(UT_TagManager &mgr, const UT_TagList &tags)
A comma separated list of tags (i.e. "fill,spot,red")
void clearTagExpressions()
std::string toStdString() const
GLuint const GLchar * name
Node * find(const std::string &name) const
const std::string & expr() const
const Node * parent() const
std::pair< std::string, VisibleInfo > VisibleOp
const std::string & material() const
GEO_ViewportLOD myViewportLOD
const std::string & name() const
SYS_FORCE_INLINE bool UTisstring(const char *s)
Node * addChild(const std::string &name)
std::pair< std::string, std::string > SetOp
static std::string theAsterisk
GEO_ViewportLOD viewportLOD() const
void rmTag(UT_TagManager &mgr, const UT_TagList &tags)
Base::const_iterator const_iterator
UT_TagExpressionPtr createExpression(const char *expr, UT_String &errs)