LightWrap++
AC++wrapperfortheLightWave3DSDK
lwpp::LayoutToolHandler Class Reference

Base class for Layout Tool plugins. More...

#include <layouttool_handler.h>

+ Inheritance diagram for lwpp::LayoutToolHandler:
+ Collaboration diagram for lwpp::LayoutToolHandler:

List of all members.

Public Member Functions

 LayoutToolHandler (void *g, void *context, LWError *err)
 Constructor.
virtual ~LayoutToolHandler ()
 Destructor.
virtual int adjust (LWToolEvent *lwtool_event, int i)
 Drag the given handle to a new location.
virtual int count (LWToolEvent *lwtool_event)
 Returns the number of handles. If zero, then start is used to set the initial handle point.
virtual const char * DescLn ()
virtual int dirty ()
 Returns flag bit if either the wireframe or help string need to be refreshed.
virtual void done ()
 Destroy the instance. Called when the user discards the tool.
int down (LWToolEvent *lwtool_event)
 Process a mouse-down event. If this function returns false, handle processing will be done.
virtual void draw (LWCustomObjAccess *co_access)
 Display a wireframe representation of the tool in a 3D viewport. Typically this draws the handles.
virtual void event (int code)
 Process a general event: DROP, RESET or ACTIVATE.
int handle (LWToolEvent *lwtool_event, int i, LWDVector handle_pos)
 Returns the 3D location and priority of the handle, or zero if the handle is currently invalid.
virtual const char * help (LWToolEvent *lwtool_event)
 Returns a text string to be displayed as a help tip for this tool.
virtual LWError Load (const LoadState &ls)
 Load data from a LWLoadState.
virtual void move (LWToolEvent *lwtool_event)
 Process a mouse-move event. This is only called if the down function returned true.
virtual LWXPanelID panel ()
 Create and return a view-type xPanel for the tool instance.
virtual LWError Save (const SaveState &ss)
 Save data to a LWSaveState.
void SetClassName (const char *n)
void SetDescription (const char *n)
void SetDescription (const std::string &s)
void SetName (const char *n)
int start (LWToolEvent *lwtool_event)
 Take an initial mouse-down position and return the index of the handle that should be dragged.
void up (LWToolEvent *lwtool_event)
 Process a mouse-up event. This is only called if the down function returned true.
void Update ()
void Update (const char *cName)

Protected Attributes

const char * m_className
std::string m_description
const char * m_pluginName
InstanceUpdate m_update

Detailed Description

Base class for Layout Tool plugins.

Note:
Work in progress

Constructor & Destructor Documentation

lwpp::LayoutToolHandler::LayoutToolHandler ( void *  g,
void *  context,
LWError *  err 
)
inline

Constructor.

virtual lwpp::LayoutToolHandler::~LayoutToolHandler ( )
inlinevirtual

Destructor.


Member Function Documentation

virtual int lwpp::LayoutToolHandler::adjust ( LWToolEvent *  lwtool_event,
int  i 
)
inlinevirtual

Drag the given handle to a new location.

Drag the given handle to a new location and return the index of the handle that should continue being dragged (often the same as the input).

Parameters:
lwtool_eventThe event to the handle.
iThe number of the handle
Returns:
the index of the handle that should continue being dragged (often the same as the input)
virtual int lwpp::LayoutToolHandler::count ( LWToolEvent *  lwtool_event)
inlinevirtual

Returns the number of handles. If zero, then start is used to set the initial handle point.

Parameters:
lwtool_eventThe event to the handle.
virtual const char* lwpp::InstanceHandler::DescLn ( )
inlinevirtualinherited
virtual int lwpp::LayoutToolHandler::dirty ( )
inlinevirtual

Returns flag bit if either the wireframe or help string need to be refreshed.

virtual void lwpp::LayoutToolHandler::done ( )
inlinevirtual

Destroy the instance. Called when the user discards the tool.

int lwpp::LayoutToolHandler::down ( LWToolEvent *  lwtool_event)
inline

Process a mouse-down event. If this function returns false, handle processing will be done.

If this function returns false, handle processing will be done instead of raw mouse event processing.

Parameters:
lwtool_eventThe event to the handle.
Returns:
false if handle processing will be done instead of raw mouse event processing
virtual void lwpp::LayoutToolHandler::draw ( LWCustomObjAccess *  co_access)
inlinevirtual

Display a wireframe representation of the tool in a 3D viewport. Typically this draws the handles.

Parameters:
co_accessA custom object structure access
virtual void lwpp::LayoutToolHandler::event ( int  code)
inlinevirtual

Process a general event: DROP, RESET or ACTIVATE.

int lwpp::LayoutToolHandler::handle ( LWToolEvent *  lwtool_event,
int  i,
LWDVector  handle_pos 
)
inline

Returns the 3D location and priority of the handle, or zero if the handle is currently invalid.

Parameters:
lwtool_eventThe event to the handle.
iThe number of the handle
handle_posThe 3D location of the handle.
virtual const char* lwpp::LayoutToolHandler::help ( LWToolEvent *  lwtool_event)
inlinevirtual

Returns a text string to be displayed as a help tip for this tool.

Parameters:
lwtool_eventThe event to show the help string for.
virtual LWError lwpp::Storeable::Load ( const LoadState ls)
inlinevirtualinherited

Load data from a LWLoadState.

Parameters:
*lsLWLoadState to load from
Returns:
An error string if an error occured, 0 otherwise

Reimplemented in lwpp::LWItem, lwpp::FileName, lwpp::Image, lwpp::ColourManager, lwpp::NodeEditor, and lwpp::VParm.

virtual void lwpp::LayoutToolHandler::move ( LWToolEvent *  lwtool_event)
inlinevirtual

Process a mouse-move event. This is only called if the down function returned true.

virtual LWXPanelID lwpp::LayoutToolHandler::panel ( )
inlinevirtual

Create and return a view-type xPanel for the tool instance.

virtual LWError lwpp::Storeable::Save ( const SaveState ss)
inlinevirtualinherited

Save data to a LWSaveState.

Parameters:
*ssLWSaveState to save to
Returns:
An error string if an error occured, 0 otherwise

Reimplemented in lwpp::LWItem, lwpp::FileName, lwpp::Image, lwpp::ColourManager, lwpp::NodeEditor, and lwpp::VParm.

void lwpp::InstanceHandler::SetClassName ( const char *  n)
inlineinherited
void lwpp::InstanceHandler::SetDescription ( const char *  n)
inlineinherited
void lwpp::InstanceHandler::SetDescription ( const std::string &  s)
inlineinherited
void lwpp::InstanceHandler::SetName ( const char *  n)
inlineinherited
int lwpp::LayoutToolHandler::start ( LWToolEvent *  lwtool_event)
inline

Take an initial mouse-down position and return the index of the handle that should be dragged.

Parameters:
lwtool_eventThe event to the handle.
void lwpp::LayoutToolHandler::up ( LWToolEvent *  lwtool_event)
inline

Process a mouse-up event. This is only called if the down function returned true.

void lwpp::InstanceHandler::Update ( )
inlineinherited
void lwpp::InstanceHandler::Update ( const char *  cName)
inlineinherited

Member Data Documentation

const char* lwpp::InstanceHandler::m_className
protectedinherited
std::string lwpp::InstanceHandler::m_description
protectedinherited
const char* lwpp::InstanceHandler::m_pluginName
protectedinherited
InstanceUpdate lwpp::InstanceHandler::m_update
protectedinherited

The documentation for this class was generated from the following file: