1 #ifndef LWPP_NODE_HANDLER_H
2 #define LWPP_NODE_HANDLER_H
14 virtual int NodeInputEvent ( NodeInputID nid, LWNodalEvent nevent, ConnectionType type)
18 if (nevent == NIE_CONNECT)
Update();
19 if (nevent == NIE_INPUTNODEDESTROY)
Update();
23 static int CB_NodeInputEvent (
void *userData, NodeInputID nid, LWNodalEvent nevent, ConnectionType type)
102 Context =
static_cast<NodeID
>(context);
126 #define NF_TRANSP (1<<0) // This flag should be set if a material node might have transparency
141 unsigned int (*
flags)( LWInstance );
146 template <
class T,
int minVersion,
int maxVersion>
155 static int Activate(
int version, GlobalFunc *global, LWInstance inst,
void *serverData)
157 if ( version > maxVersion )
return AFUNC_BADVERSION;
158 if ( version < minVersion )
return AFUNC_BADVERSION;
169 plugin->evaluate = NodeAdaptor::evaluate;
170 plugin->customPreview = NodeAdaptor::customPreview;
173 else if (version == 2)
179 plugin->
evaluate = NodeAdaptor::evaluate;
181 plugin->
flags = NodeAdaptor::flags;
184 return AFUNC_BADVERSION;
186 catch (std::exception &e)
194 static void evaluate (LWInstance instance,
LWNodalAccess* na, NodeOutputID outID, NodeValue value)
200 T *plugin =
static_cast<T *
>(instance);
201 plugin->Evaluate(na, outID, value);
204 catch (std::exception &e)
210 static void customPreview (LWInstance instance,
int width,
int height )
214 T *plugin =
static_cast<T *
>(instance);
215 plugin->CustomPreview(width, height);
217 catch (std::exception &e)
222 static unsigned int flags (LWInstance instance)
226 T *plugin =
static_cast<T *
>(instance);
227 return plugin->Flags();
229 catch (std::exception &e)
246 virtual int NodeInputEvent ( NodeInputID nid, LWNodalEvent nevent, ConnectionType type)
251 virtual void ChangeNotify (LWXPanelID ,
unsigned int ,
unsigned int ,
int event_type)
253 if ( ( event_type == LWXPEVENT_VALUE ) || ( event_type == LWXPEVENT_HIT ) )
257 else if (event_type == LWXPEVENT_TRACK)
269 #endif // LWPP_NODE_HANDLER_H