MQBasePlugin class

(new in Rev2.40)

MQBasePlugin class is a base class for all types of plug-ins. It is available as a class library by adding MQBasePlugin.cpp and MQBasePlugin.h to a project. You can make a command plug-in with a simple implementation and without taking care of complex message procedures by returning an inherited class in GetPluginClass().

Several plug-in functions are declared as virtual functions in MQBasePlugin class. It is necessary to implement them in an inherited class.

Class
MQBasePlugin Constructor
~MQBasePlugin Destructor
Plug-in
GetPlugInID Get a plug-in ID
GetPlugInName Get a plug-in name
GetPlugInType Get a type of a plug-in
Supplemental functions
OpenSetting Get a setting file
CloseSetting Close a setting file
GetResourceString Get a resource string
GetSettingValue Get a setting value
GetSystemColor Get a system color
SendUserMessage Send a plugin-in own message to the other plug-ins

MQBasePlugin::MQBasePlugin();

It is a constructor.


virtual MQBasePlugin::~MQBasePlugin();

It is a destructor. It is declared as a virtual function.


virtual void MQBasePlugin::GetPlugInID(DWORD *Product, DWORD *ID);

Product
A pointer to receive a product(author) name
ID
A pointer to receive a product ID

It returns a product(author) name and a product ID as a 64-bit value.

The 'Product' and 'ID' can be random values which do not overlap with others.

This method is declared as a pure virtual function. It conceals MQGetPlugInID() by implementing in an inherited class.


virtual const char *MQBasePlugin::GetPlugInName();

Return value
This plug-in's name

It returns a plug-in name to display on the [About plug-ins] dialog.

This method is declared as a pure virtual function. It conceals MQGetPlugInName() by implementing in an inherited class.

 


virtual int MQBasePlugin::GetPlugInType();

Return value
A type of a plug-in
[MQPLUGIN_TYPE_IMPORT] Import
[MQPLUGIN_TYPE_EXPORT] Export
[MQPLUGIN_TYPE_CREATE] Create objects
[MQPLUGIN_TYPE_OBJECT] Modify objects
[MQPLUGIN_TYPE_SELECT] Modify the selected part
[MQPLUGIN_TYPE_STATION] Station
[MQPLUGIN_TYPE_COMMAND] Command (new in Rev2.41)

It returns a type of the plug-in.

This method is declared as a pure virtual function. It conceals MQGetPlugInType() by implementing in an inherited class.


MQSetting *MQBasePlugin::OpenSetting();

Return value
A setting object

It gets a class to access to a "metaseq.setting.xml" file to save settings of Metasequoia. You can load and save plug-in original settings through the class.

The setting class must be delete by CloseSetting().

(in Rev4.00)

A file to access had been changed from "metaseq.ini" into "metaseq.setting.xml".


void MQBasePlugin::CloseSetting(MQSetting *setting);

setting
A setting object

It closes a setting object opened by OpenSetting().


std::wstring MQBasePlugin::GetResourceString(const char *id);

id
Resource string ID
Return value
String

(new in Rev4.00)

It returns a string defined in command.xml for the current language.


std::wstring MQBasePlugin::GetSettingValue(MQSETTINGVALUE_TYPE type);

type
Setting value type
[MQSETTINGVALUE_LANGUAGE] Language
Return value
A setting value

(new in Rev4.02)

It returns a setting value in the system.


MQColor MQBasePlugin::GetSystemColor(MQSYSTEMCOLOR_TYPE color_type);

color_type
A type of a color
[MQSYSTEMCOLOR_OBJECT] Object
[MQSYSTEMCOLOR_SELECT] Selection
[MQSYSTEMCOLOR_TEMP] Temporal object
[MQSYSTEMCOLOR_HIGHLIGHT] Highlight
[MQSYSTEMCOLOR_UNACTIVE] Unactive
[MQSYSTEMCOLOR_MESH_YZ] YZ plane
[MQSYSTEMCOLOR_MESH_ZX] ZX plane
[MQSYSTEMCOLOR_MESH_XY] XY plane
[MQSYSTEMCOLOR_BLOB_PLUS] Blob +
[MQSYSTEMCOLOR_BLOB_MINUS] Blob -
[MQSYSTEMCOLOR_UV] UV unwrap
[MQSYSTEMCOLOR_AXIS_X] X axis
[MQSYSTEMCOLOR_AXIS_Y] Y axis
[MQSYSTEMCOLOR_AXIS_Z] Z axis
[MQSYSTEMCOLOR_AXIS_W] Center axis
[MQSYSTEMCOLOR_AXIS_ACTIVE] Active axis
[MQSYSTEMCOLOR_PREVIEW_BACK] Preview background
Return value
Color

(new in Rev4.02)

It returns a system color.


int MQBasePlugin::SendUserMessage(MQDocument doc, DWORD target_product, DWORD target_id, const char *description, void *param);

doc
A document
target_product
A product ID to send a message
target_id
A plug-in ID to send a message
description
An arbitrary string described a message type
message
An arbitrary message
Return value
Returned value by the plug-in

(new in Rev2.41)

It sends an arbitrary message to the other station or command plug-in.

You can send an arbitrary data to the target plug-in by storing a pointer in message.

The message will be sent to all plug-in when you set 0 to target_product and 0 to target_id.

The message is received in MQStationPlugin::OnReceiveUserMessage() of the target plug-in.

 

Attention: The return value cannot be received correctly in Ver2.4.4 or older version.