MQStationPlugin class

(new in Rev2.40)

MQStationPlugin class inherits MQBasePlugin class, and provides functions necessary for an implementation of a station plug-in.

You can make a station plug-in with a simple implementation and without taking care of complex message procedures between a plug-in and a main part of Metasequoia by inheriting this MQStationPlugin class and implementing required virtual functions.

In MQStationPlugin class, each plug-in member functions and messages are declared as virtual functions. It is necessary to implement the virtual function in the inherited class.

 

Class
MQStationPlugin Constructor
~MQStationPlugin Destructor
CreateNewPlugin Create a new plugin class
Declared in super class
GetPlugInID Get a plug-in ID
GetPlugInName Get a plug-in name
Plug-in
GetPlugInType Get a plug-in type
EnumString Get a string displayed in a menu or on a button
EnumSubCommand Enumerate sub commands
GetSubCommandString Get a sub command's displayed string
Initialize Initialize an application
Exit Exit an application
Message procedure
Activate A message for activating or deactivation a window
IsActivated A message for checking an activated state of a plug-in
OnSubCommand A message for calling a sub command
OnSwitchSubCommand A message for switching a sub command
OnMinimize A message for minimizing a window
OnReceiveUserMessage A message for receiving a plug-in own message
OnDraw A message for drawing
OnNewDocument A message for initializing a document
OnEndDocument A message for exiting a document
OnSaveDocument A message for saving a document
OnSavePastDocument A message for saving past state documents, for example crash.
OnUndo A message for an undo
OnRedo A message for an redo
OnUpdateUndo A message for updating an undo state
OnObjectModified A message for editing objects
OnObjectSelected A message for selecting objects
OnUpdateObjectList A message for changing a current object
OnMaterialModified A message for modifying parameters of materials
OnUpdateMaterialList A message for changing a current material
OnUpdateScene A message for updating a scene
OnChangeEditOption A message for chainging an edit option
OnConfigurationChanged A message for chaining configurations
OnQueryInterpolate A message for querying interpolation of a vertex or face attribute value
OnInterpolateVertexData A message for interpolating a vertex attribute value
OnInterpolateApexData A message for interpolating an apex attribute value
OnUseClipboard A message for using a clipboard
Supplemental functions for the super class
OpenSetting Open a setting file
CloseSetting Close a setting file
GetResourceString Get a resource string
GetSettingValue Get a setting value
GetSystemColor Get a system color
GetResourceCursor Get a default mouse cursor
GetScreenMouseCursor Get a mouse cursor for a screen
SetScreenMouseCursor Set a mouse cursor for a screen
GetLUTCount Get a number of LUTs
GetLUTName Get a LUT's name
GetLUTData Get LUT data
GetSceneOption Get display options of the scene
GetEditOption Get edit options
GetDisplayUnit Get a display unit
GetDisplayUnitString Get display unit's string and scale/td>
GetFilename Get a filename
SaveDocument Save a document
InsertDocument Insert a document
EnumLoadableImages Get loadable image formats
SendUserMessage Send a plugin-in own message to the other plug-ins
SetDrawProxyObject Set a draw proxy object
UpdateUndo Update an undo buffer
Supplemental functions
WindowClose Close a window
BeginCallback Begin the callback procedure
ExecuteCallback Implementation for the callback
CreateDrawingObject Add a drawing object in OnDraw()
CreateDrawingObjectByClone Add a drawing object by cloning a source object in OnDraw()
CreateDrawingMaterial Add a material for a drawing object in OnDraw()
CreateDrawingMaterialByClone Add a material for a drawing object by cloning a source material in OnDraw()
CreateDrawingText Add a drawing text in OnDraw()
DeleteDrawingObject Delete a drawing object
DeleteDrawingMaterial Delete a material for drawing objects
DeleteDrawingText Delete a drawing text
GetCurrentUndoState Get a current undo state
ExecuteUndo Execute an undo
ExecuteRedo Execute an redo
ClearUndoBuffer Clear an undo buffer
SetUndoUsedMemory Set used memory size of an undo
GetSnappedPos Get a snapped position

MQStationPlugin::MQStationPlugin();

This method is a constructor.


virtual MQStationPlugin::~MQStationPlugin();

This method is a destructor. It is defined as a virtual function.


virtual MQBasePlugin *MQStationPlugin::CreateNewPlugin();

Return value
A plug-in class

Creates a new plugin class for another document.

This function is for Mac only, and it is defined as a pure virtual function.


virtual int MQStationPlugin::GetPlugInType();

Return value
A plug-in type
[MQPLUGIN_TYPE_STATION] Station plug-in

This method implements a virtual function declared by MQBasePlugin::GetPlugInType(). No additional implementation is necessary in an inherited class.


virtual const char *MQStationPlugin::EnumString();

Return value
A string displayed in a menu or on a button

It returns a display string in a menu (for Station plug-in) or on a button (for Command plug-in).

This method is declared as a pure virtual function, and it disappears MQEnumString() by implementing in the inherited class.


virtual const char *MQStationPlugin::EnumSubCommand(int index);

index
An index of a sub command
Return value
A sub command's identifier string

It returns a name for a sub command which can be assigned a shortcut key.

This method is repeatedly called with an increment of index from 0. When the return value is NULL, an enumeration will be finished.

This method is declared as a virtual function, and no sub command is registered in MQStationPlugin. Please implement EnumSubCommand(), GetSubCommandString() and OnSubCommand() in an inheriting class if you want to sub command(s).

And when a button is registered by MQWidgetBase::RegisterSubCommandButton(), a shortcut key assigned to the sub command will be shown on the button.


virtual const wchar_t *MQStationPlugin::GetSubCommandString(int index);

index
An index of a sub command
Return value
A sub command's displayed string

It returns a displayed string of the sub command with the specified index.


virtual BOOL MQStationPlugin::Initialize();

Return value
Whether to succeed to initialize
[TRUE] Succeeded to initialize
[FALSE] Failed to initialize

This method is called when Metasequoia starts up or after loading the plug-in DLL by the "About plug-ins" dialog.

This method is declared as a pure virtual function, and you must implement in an inherited class. Though what to be implemented is not specified, it generally creates a window displayed when it is called from a menu.

 

Attention: In Ver2.4.3 or older version, Initialize() is also called multiply after loading the DLL for a bug. It is only called just after loading the DLL in Ver2.4.4 or later version


virtual void MQStationPlugin::Exit();

This method is called when Metasequoia quits or before unloading the plug-in DLL by the "About plug-ins" dialog.

This method is declared as a pure virtual function, and you must implement in an inherited class. Though what to be implemented not specified, it generally releases resources allocated by Initialize().


virtual BOOL MQStationPlugin::Activate(MQDocument doc, BOOL flag);

doc
A document
flag
A required active-state
[TRUE] Required to activate a window
[FALSE] Required to deactivate a window
Return value
Whether to succeed the required procedure
[TRUE] The procedure has been succeeded
[FALSE] The procedure has not been done with

This method is called to changed the activation state when the menu for this plug-in is clicked.

This method is declared as a pure virtual function, and you must implement in an inherited class. Though what to be implemented is not specified, it generally shows or hides a window created by Initialize().

Regardless of the required active-state, it must return the active-state after calling this function.


virtual BOOL MQStationPlugin::IsActivated(MQDocument doc);

doc
A document
Return value
Whether to be active
[TRUE] Active
[FALSE] Inactive

It returns whether this plug-in  is active.

This method is declared as a pure virtual function, and you must implement in an inherited class.

Though what to be implemented is not specified, it generally returns TRUE when the window managed in the plug-in is displayed, and returns FALSE when it is hidden.


virtual BOOL MQStationPlugin::OnSubCommand(MQDocument doc, int index);

doc
A document
index
An index of a sub command
Return value
[TRUE] Modified the document
[FALSE] Nothing is modified in the document

This method is called when a shortcut key assigned to a sub command returned by EnumSubCommand() is pressed.

This method is declared as a virtual function, and nothing is done in the MQStationPlugin. Please implement a procedure for a sub command in an inheriting class.


virtual BOOL MQStationPlugin::OnSwitchSubCommand(MQDocument doc);

doc
A document
Return value
[TRUE] Modified the document
[FALSE] Nothing is modified in the document

This method is called when a shortcut key assigned to this command is pressed continuously.

This method is declared as a virtual function, and nothing is done in the MQStationPlugin. Please implement a procedure for a sub command in an inheriting class.

It is not necessary to switch a sub command actually, and you can define any procedure in this method.


virtual BOOL MQStationPlugin::OnMinimize(MQDocument doc, BOOL flag);

doc
A document
Return value
Whether to minimize
[TRUE] Minimized
[FALSE] Restore to the state before minimized

This method is called when a main window of Metasequoia is minimized.

This method is declared as a virtual function, and it does nothing in a default action. You can do some operations by implementing in the inherited class if necessary.


virtual int MQStationPlugin::OnReceiveUserMessage(MQDocument doc, DWORD src_product, DWORD src_id, const char *description, void *message);

doc
A document
src_product
A product ID of a sender plug-in
src_id
A plug-in ID of a sender plug-in
description
A string representing the contents of the message
message
A content of the message
Return value
An arbitrary value to return to the sender plug-in

(new in Rev2.41)

This method is called when a message by MQBasePlugin::SendUserMessage() is sent from the other plug-in.

This method is declared as a virtual function, and it does nothing in a default action. You can exchange data between plug-ins by implementing in an inherited class and a sender plug-in if necessary.


virtual void MQStationPlugin::OnDraw(MQDocument doc, MQScene scene, int width, int height);

doc
A document
scene
A scene
width
A width of the drawing area
description
A height of the drawing area

This method is called when the drawing a scene.

This method is declared as a virtual function, and it does nothing in a default action. You can draw your own plug-in object in the scene by implementing in the inherited class if necessary.

An object or a material used only while a drawing can be created by CreateDrawingObject() or CreateDrawingMaterial().


virtual void MQStationPlugin::OnNewDocument(MQDocument doc, const char *filename, NEW_DOCUMENT_PARAM& param);

doc
A document
filename
File name
[not NULL] The filename when MQO file has been loaded
[NULL] Created as a new document
param
Initial parameters

This method is called when a document is initialized.

filename is set only when a MQO file has been loaded, and it is NULL when other format file has been imported.

If a XML element has been registered through OnSaveDocument() when saving a file, the XML element will be set in param.elem.

This method is declared as a virtual function, and it does nothing in a default action. You can do some operations by implementing in the inherited class if necessary.

struct NEW_DOCUMENT_PARAM {
    MQXmlElement elem;
};
elem
[not NULL] A xml element added when a file is saved
[NULL] It is created as a new document, or a XML element has not been saved

virtual void MQStationPlugin::OnEndDocument(MQDocument doc);

doc
A document

This method is called when a document exits.

This method is declared as a virtual function, and it does nothing in a default action. You can do some operations by implementing in the inherited class if necessary.

When a drawing object or a material created by CreateDrawingObject() or CreateDrawingMaterial() which instant is FALSE remains, please delete it by DeleteDrawingObject() or DeleteDrawingMaterial() in this function.


virtual void MQStationPlugin::OnSaveDocument(MQDocument doc, const char *filename, SAVE_DOCUMENT_PARAM& param);

doc
A document
filename
MQO file name
param
Saving parameters

This method is called just before saving a document to a MQO file.

A XML element is set in param.elem, and plug-in own data can be saved together with a .MQO file by registering the child element. The XML element is saved in an external XML file, and it is linked from a MQO file.

This method is declared as a virtual function, and it does nothing in a default action. You can do some operations by implementing in the inherited class if necessary.

struct SAVE_DOCUMENT_PARAM {
    MQXmlElement elem;
    BOOL bSaveUniqueID;
    int PastState;
};
elem
[not NULL] A xml element added when a file is saved
[NULL] It is created as a new document, or a XML element has not been saved
bSaveUniqueID
Whether to save an unique ID in a MQO file
PastState (new in Rev4.60)
Undo counter for past undo

virtual void MQStationPlugin::OnSavePastDocument(MQDocument doc, const char *filename, SAVE_DOCUMENT_PARAM& param);

doc
A document
filename
MQO file name
param
Saving parameters

(new in Rev4.60)

This method is called just before saving past state documents to a MQO file, for example crash.

Plug-in own data can be saved as OnSaveDocument(), normally, corresponding param.PastState data be saved.

For saving other than, this method is called with param.elem is nullptr, to Check whether to save an unique id. in this case, param.bSaveUniqueID can be changed if necessary.。

This method is declared as a virtual function, and it does nothing in a default action. You can do some operations by implementing in the inherited class if necessary.


virtual BOOL MQStationPlugin::OnUndo(MQDocument doc, int undo_state);

doc
A document
undo_state
An undo state counter
Return value
Whether to do with data in the document by a plug-in own undo operation
[FALSE] Not operate

This method is called when an undo is operated.

This method is declared as a virtual function, and it does nothing in a default action. You can do some operations by implementing in the inherited class if necessary.

 

In current version, a plug-in own undo operation is not allowed. You can refer data in the document and do with plug-in own data managed. But, do not do with data in the document. Return FALSE always. A return value is reserved for a future version.


virtual BOOL MQStationPlugin::OnRedo(MQDocument doc, int redo_state);

doc
A document
redo_state
An undo state counter
Return value
Whether to do with data in the document by a plug-in own redo operation
[FALSE] Not operate

This method is called when a redo is operated.

This method is declared as a virtual function, and it does nothing in a default action. You can do some operations by implementing in the inherited class if necessary.

 

In current version, a plug-in own redo operation is not allowed. You can refer data in the document and do with plug-in own data managed. But, do not do with data in the document. Return FALSE always. A return value is reserved for a future version.


virtual void MQStationPlugin::OnUpdateUndo(MQDocument doc, int undo_state, int undo_size);

doc
A document
undo_state
An undo state counter
undo_size
A number which can operate an undo

This method is called when an undo state has been updated.

Do not modify objects moreover in this function.


virtual void MQStationPlugin::OnObjectModified(MQDocument doc);

doc
A document

This method is called when an object is modified.

Do not modify objects moreover in this function.


virtual void MQStationPlugin::OnObjectSelected(MQDocument doc);

doc
A document

This method is called when vertices, lines, faces or UV vertices in objects are selected.

Do not modify objects or the selection moreover in this function.


virtual void MQStationPlugin::OnUpdateObjectList(MQDocument doc);

doc
A document

This method is called when a current object is changed, or an object is added or deleted.

Do not modify objects or the selection moreover in this function.


virtual void MQStationPlugin::OnMaterialModified(MQDocument doc);

doc
A document

This method is called when a parameter in a material is changed.

Do not modify objects or materials moreover in this function.


virtual void MQStationPlugin::OnUpdateMaterialList(MQDocument doc);

doc
A document

This method is called when a current material is changed, or a material is added or deleted.

Do not modify materials moreover in this function.


virtual void MQStationPlugin::OnUpdateScene(MQDocument doc, MQScene scene);

doc
A document
scene
A scene

This method is called when a scene information is changed such as a direction of a camera or a zoom rate.

Do not modify the scene moreover in this function.


virtual void MQStationPlugin::OnChangeEditOption(MQDocument doc, EDITOPTION_TYPE trigger);

doc
A document
trigger
A changed item
[EDITOPTION_SCREEN] Edit on a screen coordinate
[EDITOPTION_WORLD] Edit on a world coordinate
[EDITOPTION_LOCAL] Edit on a local coordinate

(new in Rev4.40)

This method is called when an edit option is changed.


virtual void MQStationPlugin::OnConfigurationChanged(MQDocument doc);

doc
A document

(new in Rev4.64)

This method is called when configuration is changed.


virtual bool MQStationPlugin::OnQueryInterpolate(MQDocument doc, MQObject dstobj, MQObject srcobj, INTERPOLATE_TYPE type, INTERPOLATE_REASON reason);

doc
A document
dstobj
A destination object
srcobj
A source object
type
Interpolation type
[INTERPOLATE_VERTEX] for vertex
[INTERPOLATE_APEX] for apex
reason
Reason of interpolation
[INTERPOLATE_BY_OTHER] Other
[INTERPOLATE_BY_CLONE_OBJECT] Clone objects
[INTERPOLATE_BY_MERGE_OBJECT] Merge objects
[INTERPOLATE_BY_PATCH] Freeze patch
[INTERPOLATE_BY_MIRROR] Freeze mirror or symmetry copy
Return value
Whether interpolation is required

(new in Rev4.72)

Called to check whether or not an interpolation of the plugin's unique attribute value is necessary when the attribute value of the vertex or apex is interpolated.

Please return true only when an interpolation is necessary. OnInterpolateVertexData() and OnInterpolateApexData() will be not called when false is returned.

Depending on the reason for interpolation, dstobj and srcobj may be the same object.


virtual bool MQStationPlugin::OnInterpolateVertexData(MQDocument doc, MQObject obj, int vert, INTERPOLATE_VERTEX_PARAM *valarray, int valnum);

doc
A document
obj
A destination object
vert
An index of a destination vertex
valarray
An array of source vertices
valnum
A number of valarray

(new in Rev4.72)

Called when the it is necessary to interpolate the plugin's own vertex attribute values. Please implement your own interpolation of attribute values.


virtual bool MQStationPlugin::OnInterpolateApexData(MQDocument doc, MQObject obj, int face, int apex, INTERPOLATE_APEX_PARAM *valarray, int valnum);

doc
A document
obj
A destination object
face
An index of a destination face
apex
An index of a destination apex
valarray
An array of source apices
valnum
A number of valarray

(new in Rev4.72)

Called when the it is necessary to interpolate the plugin's own apex attribute values. Please implement your own interpolation of attribute values.


virtual bool MQStationPlugin::OnUseClipboard(MQDocument doc, MQObject obj, CLIPBOARD_METHOD method, CLIPBOARD_PARAM& param);

doc
A document
obj
An object
method
How to use the clipboard
[CLIPBOARD_QUERY_COPY] Whether copying to clipboard is possible
[CLIPBOARD_COPY] Copy to clipboard
[CLIPBOARD_PASTE] Paste from clipboard
param
Parameters
Return value
Whether processing has been performed

(new in Rev4.72)

Called when a copy / paste operation using the clipboard is performed. Please return true if it is necessary to store or retrieve the plug-in's own content.

When the method is CLIPBOARD_QUERY_COPY, please return true or false base on SelectedVertexCount, SelectedLineCount or SelectedFaceCount in param or plugin's own selection status.

When the method is CLIPBOARD_COPY, it is necessary to call param.AllocBuffer() and store plugin's own content to the returned buffer. obj has a result of merging selected faces, and you can know which vertex or face is corresponding with the original one by MakeOrgVertexIDTable(), MakeOrgFaceIDTable(), MakeOrgVertexIDToNewIndexMap() or MakeOrgFaceIDToNewIndexMap() in param.

When the method is CLIPBOARD_PASTE, please implement plugin's own paste operation by reading from Buffer and BufferSize in param. obj is a new object created by the paste operation.


void MQStationPlugin::WindowClose();

If you call this method when the window managed by this plug-in is closed, it will be notified to the main part of Metasequoia and the check on a menu will become off.


void MQStationPlugin::BeginCallback(void *option);

option
An arbitrary data to give to a callback function

Call this function when you want to process the response for Windows messages in a plug-in. After an initialization, ExecuteCallback() will be called and you can do with a process for a MQDocument in the function.


virtual bool MQStationPlugin::ExecuteCallback(MQDocument doc, void *option);

doc
A document
option
An arbitrary data given by BeginCallback()
Return value
[TRUE] Modified the document
[FALSE] Nothing is modified in the document
 

A callback procedure called by BeginCallback() is implemented in this function.

This method is declared as a pure virtual function, and you must implement in an inherited class.


MQObject MQStationPlugin::CreateDrawingObject(MQDocument doc, DRAW_OBJECT_VIISIBILITY visibility, BOOL instant=TRUE);

doc
A document
visibility
[DRAW_OBJECT_POINT] Show vertices
[DRAW_OBJECT_LINE] Show lines
[DRAW_OBJECT_FACE] Show faces
instant
Whether to create as a temporal object
Return value
A created object

It adds a drawing object while OnDraw() is called.

The created object must not be deleted by MQObject::DeleteThis() or MQDocument::DeleteObject().

The object created with specifying TRUE for 'instant' will be deleted automatically after drawing is completed. The object created with specifying FALSE for 'instant' must be deleted by DeleteDrawingObject() when is becomes unnecessary or OnEndDocument() is called.


MQObject MQStationPlugin::CreateDrawingObjectByClone(MQDocument doc, MQObject clone_source, DRAW_OBJECT_VISIBILITY visibility, BOOL instant=TRUE);

doc
A document
clone_source
A source object to clone
visibility
[DRAW_OBJECT_POINT] Show vertices
[DRAW_OBJECT_LINE] Show lines
[DRAW_OBJECT_FACE] Show faces
instant
Whether to create as a temporal object
Return value
A created object

It adds a drawing object by cloning a source object while OnDraw() is called.

The created object must not be deleted by MQObject::DeleteThis() or MQDocument::DeleteObject().

The object created with specifying TRUE for 'instant' will be deleted automatically after drawing is completed. The object created with specifying FALSE for 'instant' must be deleted by DeleteDrawingObject() when is becomes unnecessary or OnEndDocument() is called.


MQMaterial MQStationPlugin::CreateDrawingMaterial(MQDocument doc, int& index, BOOL instant=TRUE);

doc
A document
index
An index of the created material
instant
Whether to create as a temporal material
Return value
A created material

It add a material for a drawing object created by CreateDrawingObject() while OnDraw() is called.

The index stored in the 'index' variable is available for MQObject::SetFaceMaterial().

The created material must not be deleted by MQMaterial::DeleteThis().

The material created with specifying TRUE for 'instant' will be deleted automatically when drawing is completed. The material created with specifying FALSE for 'instant' must be deleted by DeleteDrawingMaterial() when it becomes  unnecessary or OnEndDocument() is called.


MQMaterial MQStationPlugin::CreateDrawingMaterialByClone(MQDocument doc, MQMaterial clone_source, int& index, BOOL instant=TRUE);

doc
A document
clone_source
A source material to clone
index
An index of the created material
instant
Whether to create as a temporal material
Return value
A created material
 

It add a material by cloning a source material for a drawing object created by CreateDrawingObject() while OnDraw() is called.

The index stored in the 'index' variable is available for MQObject::SetFaceMaterial().

The created material must not be deleted by MQMaterial::DeleteThis().

The material created with specifying TRUE for 'instant' will be deleted automatically when drawing is completed. The material created with specifying FALSE for 'instant' must be deleted by DeleteDrawingMaterial() when it becomes  unnecessary or OnEndDocument() is called.


MQDrawingText MQStationPlugin::CreateDrawingText(MQDocument doc, const wchar_t *text, DRAWING_TEXT_PARAM& param, BOOL instant=TRUE);

doc
A document
text
A displayed string
param
Parameters for drawing
instant
Whether to create as a temporal text
Return value
A created text

(new in Rev4.50)

It adds a drawing text while OnDraw() is called.

The text created with specifying TRUE for 'instant' will be deleted automatically after drawing is completed. The object created with specifying FALSE for 'instant' must be deleted by DeleteDrawingText() when is becomes unnecessary or OnEndDocument() is called.

struct DRAWING_TEXT_PARAM {
    MQPoint ScreenPos;
    MQColor Color;
    float FontScale;
    DRAWING_TEXT_ALIGNMENT HorzAlign;
    DRAWING_TEXT_ALIGNMENT VertAlign;
};
ScreenPos
A position on a screen coordinate
Color
A displayed color
FontScale
A scaling rate of a font
HorzAlign
横方向の位置
[TEXT_ALIGN_LEFT] 左寄せ
[TEXT_ALIGN_CENTER] 中央
[TEXT_ALIGN_RIGHT] 右寄せ
VertAlign
縦方向の位置
[TEXT_ALIGN_TOP]
[TEXT_ALIGN_CENTER] 中央
[TEXT_ALIGN_RIGHT]

void MQStationPlugin::DeleteDrawingObject(MQDocument doc, MQObject obj);

doc
A document
obj
A drawing object

It deletes a object created by CreateDrawingObject() which the 'instant' is FALSE.


void MQStationPlugin::DeleteDrawingMaterial(MQDocument doc, MQMaterial mat);

doc
A document
mat
A material for drawing objects

It deletes a material created by CreateDrawingMaterial() which the 'instant' is FALSE.


void MQStationPlugin::DeleteDrawingText(MQDocument doc, MQDrawingText text);

doc
A document
obj
A drawing text

(new in Rev4.50)

It deletes a text created by CreateDrawingText() which the 'instant' is FALSE.


int MQStationPlugin::GetCurrentUndoState(MQDocument doc);
bool GetCurrentUndoState(MQDocument doc, UNDO_STATE& undo_state)

doc
A document
state
An undo state for receiving
Return value
(int)A counter of an undo state, (bool) Succeeded or failed

It gets a counter of an undo state.

(new in Rev4.59)

struct UNDO_STATE {
	int state;
	bool can_undo;
	bool can_redo;
};
state
An undo state
can_undo
Undoable or not
can_redo
Redoable or not

bool MQStationPlugin::ExecuteUndo(MQDocument doc);

doc
A document
Return value
Succeeded or failed.

(new in Rev4.59)

It executes an undo operation.


bool MQStationPlugin::ExecuteRedo(MQDocument doc);

doc
A document
Return value
Succeeded or failed.

(new in Rev4.59)

It executes an redo operation.


bool MQStationPlugin::ClearUndoBuffer(MQDocument doc);

doc
A document
Return value
Succeeded or failed.

(new in Rev4.59)

It clears an undo buffer.


void MQStationPlugin::SetUndoUsedMemory(MQDocument doc, int target_undo_state, size_t data_size)

doc
a document
target_undo_state
A target undo state counter
data_size
an used memory size

(new in Rev4.60)

Set an used memory size of a target undo state counter.

When this function called,an entire used memory size of an undo buffer is checked, and a number which can operate an undo is updated if necessary.

(in Rev4.80)

The arguments have been changed.


[deprecated]
MQPoint MQStationPlugin::GetSnappedPos(MQScene scene, const MQPoint& p, SNAP_GRID_TYPE type);

(new in Rev4.20)
MQPoint MQStationPlugin::GetSnappedPos(MQScene scene, const MQPoint& p, const EDIT_OPTION& option, const GET_SNAP_PARAM& snap_param);

scene
A scene
p
A position before snapping
type
The direction for snapping (One or multiple values can be selected)
[SNAP_GRID_X] Snap in the X axis
[SNAP_GRID_Y] Snap in the Y axis
[SNAP_GRID_Z] Snap in the Z axis
option
Edit option
snap_param
Snapping parameters
Return value
A position after snapping

It gets a snapped position for a grid, a plane, vertices, lines, faces and so on specified in the edit option.

'eye_dir' is usually specified TRUE when a vertices is operated directly or a center of a handle is operated. It is FALSE when a X, Y or Z axis of a handle is operated.

Please change the contents of the edit option if you want to snap to elements that are not specified in the current edit option.

 

Attention: The deprecated format is still left, but please replace it with the new format to enable to snap elements except a grid.

struct GET_SNAP_PARAM {
    BOOL SnapEyeDir;                // Snap on the eye direction
    BOOL IgnoreSelected;            // Ignore selected elements
    BOOL IgnoreCurObj;              // Ignore current object
};
SnapEyeDir
It specifies whether to snap to the eye direction.
It is usually specified TRUE when a vertices is operated directly or a center of a handle is operated. It is FALSE when a X, Y or Z axis of a handle is operated.
IgnoreSelected
It specifies whether ignore selected vertices, lines and faces or not.
When the selected part is moved, TRUE is specified for avoiding to snap the target to move.
IgnoreCurObj
It specifies whether ignore selected vertices, lines and faces or not.
When the current object is moved, TRUE is specified for avoiding to snap the current object to move.