Clarisse 4.0 SP5b SDK  4.0.0.0.5.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
ModuleTool Class Reference

This class implements Tools in Clarisse. More...

Inheritance diagram for ModuleTool:
ModuleObject OfModule ResourceUser EventObject CoreCustomData CoreBaseObject CoreBaseType

Public Types

enum  Mode {
  MODE_VALUE,
  MODE_OFFSET,
  MODE_PIVOT,
  MODE_COUNT
}
 
enum  Space {
  SPACE_LOCAL,
  SPACE_WORLD,
  SPACE_GIZMO,
  SPACE_TRA_OBJECT,
  SPACE_ROT_GIMBAL,
  SPACE_COUNT
}
 

Public Member Functions

GuiWidgetget_options (GuiWidget &parent)
 This function returns a pointer to the GuiWidget that is used to edit the options of the Tool.
 
bool enter (CtxTool &ctx)
 This function is called when the mouse enters a Widget.
 
void leave (CtxTool &ctx)
 This function is called when the mouse exits a Widget.
 
void pre_destroy (CtxTool &ctx)
 This function is called when the Widget hosting the Tool is about to be destroyed.
 
void update (CtxTool &ctx)
 This function is called if the tool needs to be udpated, for example if the selected object changes.
 
void set_description (const CoreString &str)
 Sets the tool description.
 
const CoreStringget_description () const
 Returns the tool description.
 
const bool & is_active () const
 
void draw (CtxTool &ctx, CtxDraw &draw)
 Calls the draw callback.
 
void draw_2d (CtxTool &ctx)
 Calls the draw_2D callback.
 
void draw_3d (CtxTool &ctx)
 Calls the draw_3D callback.
 
int process_event (CtxTool &ctx, const CtxToolEvent &evt)
 Event handling.
 
bool get_bbox (CtxTool &ctx, GMathBbox3d &box)
 Retrieves the bbox defined by the tool. Return true and the gizmo bbox in world space or false if no bbox defined.
 
bool get_actions (CoreVector< GuiAction * > &actions)
 Retrieves the actions defined by the tool. Return true and fills the array or false if no action available.
 
bool is_hidden_item (CtxTool &ctx, const OfObject &item)
 This function is called when the Widget hosting the Tool repaints itself, to skip items the tool wants to be invisible.
 
virtual void reset_attribute (OfAttr *attr)
 Called by ToolOption widget to reset the given attribute, or all attributes if none is specified.
 
- Public Member Functions inherited from ModuleObject
bool is_protected () const
 
bool add_resource (const int &resource_id, const CoreBasicArray< OfAttrDirtiness > &attributes, ResourceCustom *resource_custom=0)
 
bool add_shared_resource (const int &resource_id, const int &source_resource_id)
 
bool remove_resource (const int &resource_id)
 
bool set_resource_attrs (const int &resource_id, const CoreBasicArray< OfAttr * > &attributes)
 
bool set_resource_attrs (const int &resource_id, const CoreBasicArray< OfAttrDirtiness > &attributes)
 
bool get_resource_attrs (const int &resource_id, CoreVector< OfAttr * > &attributes) const
 
bool get_resource_attrs (const int &resource_id, CoreVector< OfAttrDirtiness > &attributes) const
 
bool set_resource_deps (const int &resource_id, const CoreBasicArray< ResourceID > &deps)
 
bool get_resource_deps (const int &resource_id, CoreVector< int > &deps) const
 
bool share_resource (const int &resource_id, const int &source_resource_id)
 Make resource_id a "clone" of source_resource_id.
 
int get_shared_resource (const int &resource_id) const
 Get the source resource ID for a resource ID that has been shared.
 
void clear_resource (const int &resource_id)
 If this resource ID exists clear it, otherwise does nothing.
 
void update_resource (const int &resource_id)
 
virtual const ResourceDataget_resource (const int &resource_id, void *data=0) const
 
virtual const ResourceDatatry_get_resource (const int &resource_id) const
 
bool is_resource_created (const int &resource_id) const
 
bool is_resource_exists (const int &resource_id) const
 
bool is_sharing_resource (const ModuleObject &other, const int &resource_id) const
 
GuiWidgetdeclare_custom_ui (const CoreVector< OfAttr * > &attrs, GuiWidget &parent_widget, void *info)
 
bool update_resource_key (const int &resource_id)
 Update the key for the given resource ID and return true if it has changed.
 
void update_resource_keys ()
 Update the keys of all resource IDs for this object.
 
bool get_resource_link_id (const ResourceConnection &connection, int &resource_id) const
 Get the resource ID used by a given connection.
 
bool get_resource_link_tag (const ResourceConnection &connection, CoreString &resource_tag) const
 Like get_resource_link_id but get the resource tag (e.g. name)
 
bool get_resource_tag (ResourceObject &resource, CoreString &resource_tag) const
 Get the resource tag (name) of a given resource object.
 
OfAppget_application () const
 
virtual void post_evaluate (const CtxEval &eval_ctx) const
 
bool has_resources () const
 
const ResourceHandler & get_resource_handler () const
 
ResourceHandler & get_resource_handler ()
 
virtual void register_variable (CoreBasicArray< OfObjectVariableValue * > &variables, CoreVector< unsigned int > &unknown_variable_indices)
 register_variable method is called by the OfObject to inform the module about the variables defined in the OfObject, then module have the responsibility to update the OfObject variable values
 
virtual void unregister_variable (CoreBasicArray< OfObjectVariableValue * > &variables)
 unregister_variable method is called by the OfObject to inform the module about the no longer used variables
 
void udpate_variables_status (CoreBasicArray< unsigned int > &known_variables, CoreBasicArray< unsigned int > &unknown_variables)
 informs the module that some variables can be resolved or not.
 
virtual OfAttrget_master_input_value () const
 
virtual OfAttrget_pass_through () const
 
virtual OfAttrget_master_input () const
 
virtual unsigned int get_object_variable (const CoreString &variable_name, long long *values, const unsigned int &value_count) const
 Evaluate the object variable as a natural number.
 
virtual unsigned int get_object_variable (const CoreString &variable_name, double *values, const unsigned int &value_count) const
 Evaluate the object variable as a real number.
 
virtual size_t get_memory_size () const
 
- Public Member Functions inherited from OfModule
OfObjectget_object () const
 
void set_object (OfObject &object)
 
bool is_protected () const
 
CoreString get_object_name () const
 

Static Public Member Functions

static void set_gizmo_world_pivot (const GMathVec3d &v)
 
static void set_gizmo_custom_offset (const GMathVec3d &v)
 
static const GMathVec3d & get_gizmo_world_pivot ()
 
static const GMathVec3d & get_gizmo_custom_offset ()
 
static void set_gizmo_translate_increment (double d)
 
static void set_gizmo_rotate_increment (double d)
 
static void set_gizmo_scale_increment (double d)
 
static double get_gizmo_translate_increment ()
 
static double get_gizmo_rotate_increment ()
 
static double get_gizmo_scale_increment ()
 
static void set_mode (Mode m)
 
static const Mode & get_mode ()
 
static void set_space (Space s)
 
static const Space & get_space ()
 
static void set_transform_space (Space s)
 
static const Space & get_transform_space ()
 
static void set_linked_space (bool link)
 
static bool is_linked_space ()
 
- Static Public Member Functions inherited from ModuleObject
static ResourceID declare_resource (const char *tag)
 
static ResourceID declare_resource (const CoreString &tag)
 
static bool declare_resource (ResourceID id, const char *tag)
 
static bool declare_resource (ResourceID id, const CoreString &tag)
 
static ResourceID get_resource_id (const char *tag)
 
static ResourceID get_resource_id (const CoreString &tag)
 
static const char * get_resource_tag (ResourceID id)
 

Protected Member Functions

virtual void module_constructor (OfObject &object)
 
- Protected Member Functions inherited from ModuleObject
bool get_builtin_variable_value (const CoreString &var_name, CoreVector< CoreVariant > &value) const
 
bool get_builtin_variable_value_at (const CoreString &var_name, CoreVector< CoreVariant > &value, const double &time) const
 
virtual void module_destructor ()
 
virtual void on_attribute_change (const OfAttr &attr, int &dirtiness, const int &dirtiness_flags)
 
virtual void on_send_event (const CoreString &event)
 
virtual ResourceDatacreate_resource (const int &id, void *data) const
 
virtual void on_resource_update (const int &id, ResourceData *resource)
 
virtual bool on_new_time (const double &time)
 
virtual void * create_eval_data (const CtxEval &eval_ctx) const
 
virtual void destroy_eval_data (const CtxEval &eval_ctx, void *eval_data) const
 
virtual void * create_thread_data (const CtxEval &eval_ctx) const
 
virtual void destroy_thread_data (const CtxEval &eval_ctx, void *thread_data) const
 
virtual bool has_thread_data () const
 
virtual ModuleCmacreate_cma (const CtxEval *eval_ctx) const
 
virtual void destroy_cma (ModuleCma *cma) const
 
const bool pre_evaluate_begin (const CtxEval &eval_ctx) const
 
void pre_evaluate_end (const CtxEval &eval_ctx) const
 
virtual ResourceDataset_resource_data (const int &resource_id, ResourceData *data, const CoreString &key)
 
virtual ResourceDataset_resource_data (const int &resource_id, void *data_serial, const size_t &data_serial_size, const CoreString &key)
 
virtual unsigned int get_project_resource_count () const
 
virtual int get_project_resource_id (const unsigned int &index) const
 
virtual ResourceObject * get_project_resource (const unsigned int &index) const
 
virtual void get_attr_preset_hints (CoreArray< bool > &hints, const OfAttr &attr)
 
template<class T_Callbacks >
T_Callbacks * get_callbacks () const
 
- Protected Member Functions inherited from OfModule
void protect_object (const bool &enable) const
 
virtual void on_deserialize (const CoreVersion &serial_version, const ParserGroup &parser_group, const OfSerialOptions &serial_options)
 

Detailed Description

This class implements Tools in Clarisse.