# TBasicModule Class Reference
[Base Classes for plugins]

Inheritance diagram for TBasicModule:

List of all members.

## Public Member Functions
virtual MCCOMErr MCCOMAPI | QueryInterface (const MCIID &riid, void **ppvObj)
virtual uint32 MCCOMAPI | AddRef ()
virtual uint32 MCCOMAPI | Release ()
virtual void MCCOMAPI | Clone (IExDataExchanger **clonedObject, IMCUnknown *pUnkOuter)
virtual boolean MCCOMAPI | IsEqual (IExDataExchanger *otherDataExchanger)
virtual MCCOMErr MCCOMAPI | GetParameter (IDType keyword, void *parameter)
virtual MCCOMErr MCCOMAPI | SetParameter (IDType keyword, void *parameter)
virtual void *MCCOMAPI | GetExtensionDataBuffer ()
| You MUST implement this method if you have a pmap (the default returns NULL).
virtual MCCOMErr MCCOMAPI | ExtensionDataChanged ()
virtual MCCOMErr MCCOMAPI | HandleEvent (MessageID message, IMFResponder *source, void *data)
virtual int16 MCCOMAPI | GetResID ()
virtual MCCOMErr MCCOMAPI | Initialize (IMCUnknown *inElement)
virtual MCCOMErr MCCOMAPI | Destroy ()
virtual MCCOMErr MCCOMAPI | Hydrate ()
virtual MCCOMErr MCCOMAPI | Dehydrate ()
virtual MCCOMErr MCCOMAPI | Import (IMCUnknown *inElement, void *inImportData)
virtual MCCOMErr MCCOMAPI | BuildMenuBar ()
virtual MCCOMErr MCCOMAPI | BuildMenuBar (IMCMenuBar *theBar)
virtual MCCOMErr MCCOMAPI | GetPreferredRoom (IDType &roomId)
virtual boolean MCCOMAPI | WantsToBeInCurrentRoom ()
| Tell if the module can be inserted in the current room.
virtual boolean MCCOMAPI | SubModuleClosedMainWindow (I3DShModule *subModule)
virtual MCCOMErr MCCOMAPI | SubModuleAboutToBeDestroyed (I3DShModule *subModule)
virtual MCCOMErr MCCOMAPI | SubModuleAboutToBeHydrated (I3DShModule *subModule)
virtual boolean MCCOMAPI | HaveSubModuleActive ()
| Returns true if this master module have a sub module active.
virtual MCCOMErr MCCOMAPI | AboutToCloseMainWindow ()
virtual boolean MCCOMAPI | SavesInNativeFormat ()
| whether the module wants to save data in the nativefile format
virtual MCCOMErr MCCOMAPI | GetDefaultPropertiesClient (IPropertiesClient **outPropClient)
virtual boolean MCCOMAPI | Receive (int32 message, IMFResponder *source, void *data)
virtual boolean MCCOMAPI | SelfMenuAction (ActionNumber actionNumber)
virtual void MCCOMAPI | SelfPrepareMenus ()
virtual boolean MCCOMAPI | SelfKeyDown (TMCPlatformEvent *event)
virtual void MCCOMAPI | SelfKeyUp (TMCPlatformEvent *event)
virtual boolean MCCOMAPI | SelfToolAction (int32 inOldTool, int32 inNewTool)
virtual boolean MCCOMAPI | GetToolDropCandidate (IMFDropCandidate **outDropCandidate, int32 inToolID, IMFToolbarPart *inToolbarPart)
virtual boolean MCCOMAPI | GetIndirectToolAction (IShMouseAction **outAction, ActionNumber &outActionNumber, IMFResponder **outContext, IMFPart **outPart, const TMCPoint &inWhere, int32 inToolID, IMFToolbarPart *inToolbarPart)
virtual MCCOMErr MCCOMAPI | GetMainToolInfo (TModelerToolInfo &mainToolInfo)
virtual boolean MCCOMAPI | IsToolBarActive (int32 toolBarIndex)
virtual void MCCOMAPI | DataChanged (IChangeChannel *channel, IDType changeKind, IMCUnknown *changedData)
virtual void MCCOMAPI | BecameFirstResponder (boolean on)
virtual void MCCOMAPI | AddTools (int32 toolbarIndex, IMFToolGroup *inToolGroup)
virtual void MCCOMAPI | DocumentAttached ()
| Called when the internal module is attached to a document.
## Protected Attributes
TMCCountedPtr< IChangeChannel > | fPreferencesChangeChannel

## Detailed Description

Derive your object from this class if you want to implement a module (modeler)

See also:
  I3DExModule

## Member Function Documentation

virtual MCCOMErr MCCOMAPI TBasicModule::AboutToCloseMainWindow | ( |  | ) | `[virtual]`

AboutToCloseMainWindow() is called when your main window is about to be closed by someone else. It is very important to release any references that your module may have on your window. You do not need to close it, since this "someone" is going to do it.

Implements I3DExModule.

virtual uint32 MCCOMAPI TBasicModule::AddRef | ( |  | ) | `[inline, virtual]`

Increments the reference count of the object

Reimplemented from TBasicDataExchanger.

virtual void MCCOMAPI TBasicModule::AddTools | ( | int32 | toolbarIndex,
|  | IMFToolGroup * | inToolGroup |
| ) |  |  | `[virtual]`

Implements I3DExModule.

virtual void MCCOMAPI TBasicModule::BecameFirstResponder | ( | boolean | on | ) | `[virtual]`

Implements IMFExResponder.

virtual MCCOMErr MCCOMAPI TBasicModule::BuildMenuBar | ( | IMCMenuBar * | theBar | ) | `[virtual]`

BuildMenuBar() gives you opportunity to add menus dynamically (instead os using a MBAR resource) Use gShMenuUtilities to add menu items

Implements I3DExModule.

virtual MCCOMErr MCCOMAPI TBasicModule::BuildMenuBar | ( |  | ) | `[virtual]`

virtual void MCCOMAPI TBasicModule::Clone | ( | IExDataExchanger ** | clonedObject,
|  | IMCUnknown * | pUnkOuter |
| ) |  |  | `[virtual]`

Creates a copy of an external component. You only need to implement this method if your object has data that are not stored in its Parameter Map (Pmap).

Parameters:

  | clonedObject | : the resulting copy of the current object
  | pUnkOuter | : the internal component that needs to be linked to your object (call SetControllingUnknown(pUnkOuter) on the clone)

Reimplemented from TBasicDataExchanger.

virtual void MCCOMAPI TBasicModule::DataChanged | ( | IChangeChannel * | channel,
|  | IDType | changeKind,
|  | IMCUnknown * | changedData |
| ) |  |  | `[virtual]`

This function is called when a change has been posted on a channel on which this IChangeListener registered itself.

Parameters:

  | channel | The channel that is notifying of the change.
  | changeKind | The kind of change.
  | changedData | Data associated with the type of change.

Implements IChangeListener.

virtual MCCOMErr MCCOMAPI TBasicModule::Dehydrate | ( |  | ) | `[virtual]`

Dehydrate() is called when the module is to be dehydrated; that is, the room that it occupies is exited. If this module is a main module (i.e., it defines a room), override this function to hide any main windows and call Dehydrate() on slave modules. If this module is a slave module, override this function to destroy large caches and parts and call Dehydrate() on any subslave modules. NOTE: Deactive() is called before Dehydrate() on an active module.

Implements I3DExModule.

virtual MCCOMErr MCCOMAPI TBasicModule::Destroy | ( |  | ) | `[virtual]`

Destroy() is called once when the module is to be destroyed (e.g., Scene Document Modules are called when the document closes, Global Modules are called when the application is quit). Override this function to destroy UI elements and cleanup any data---you need destroy your slave modules, since you are in charge of them

Implements I3DExModule.

virtual void MCCOMAPI TBasicModule::DocumentAttached | ( |  | ) | `[inline, virtual]`

Called when the internal module is attached to a document.

Implements I3DExModule.

virtual MCCOMErr MCCOMAPI TBasicModule::ExtensionDataChanged | ( |  | ) | `[virtual]`

Called each time a parameter of the parameter map (Pmap) is modified. This should only be used to invalidate caches and should be quick since it can be called many times.

Reimplemented from TBasicDataExchanger.

virtual MCCOMErr MCCOMAPI TBasicModule::GetDefaultPropertiesClient | ( | IPropertiesClient ** | outPropClient | ) | `[inline, virtual]`

Get the default properties client for this module.

Parameters:

  | outPropClient |

Implements I3DExModule.

virtual void* MCCOMAPI TBasicModule::GetExtensionDataBuffer | ( |  | ) | `[virtual]`

You MUST implement this method if you have a pmap (the default returns NULL).

Reimplemented from TBasicDataExchanger.

virtual boolean MCCOMAPI TBasicModule::GetIndirectToolAction | ( | IShMouseAction ** | outAction,
|  | ActionNumber & | outActionNumber,
|  | IMFResponder ** | outContext,
|  | IMFPart ** | outPart,
|  | const TMCPoint & | inWhere,
|  | int32 | inToolID,
|  | IMFToolbarPart * | inToolbarPart |
| ) |  |  | `[virtual]`

Implements IMFExResponder.

virtual MCCOMErr MCCOMAPI TBasicModule::GetMainToolInfo | ( | TModelerToolInfo & | mainToolInfo | ) | `[inline, virtual]`

Returns the information about the main tool that activate the modeler in the 3DView. Note that this function is only implemented by modelers that can be instantiated in the 3DView (Vertex Modeler, 3D Paint...).

Parameters:

  | mainToolInfo | A struct describing the tool.

Implements I3DExModule.

virtual MCCOMErr MCCOMAPI TBasicModule::GetParameter | ( | IDType | keyword,
|  | void * | parameter |
| ) |  |  | `[virtual]`

Returns the value of a given parameter of this dataExchanger. This function is called when the shell cannot find the given parameter in the Parameter Map (Pmap) of the component You need to implement this method only if your object has parameters that are not inside the parameter map.

Parameters:

  | keyword | The ID of the parameter.
  | parameter | A pointer to buffer where the value of the parameter can be copied.

Reimplemented from TBasicDataExchanger.

virtual MCCOMErr MCCOMAPI TBasicModule::GetPreferredRoom | ( | IDType & | roomId | ) | `[virtual]`

If the module does not define a room (eg the rendering module), this function is called to determine in which room the module wants to be put in. By default the module will be added in the current room.

Implements I3DExModule.

virtual int16 MCCOMAPI TBasicModule::GetResID | ( |  | ) | `[virtual]`

Returns the resource ID of the NodePart used for the properties of the component.
Return 0 to use the default node id (the same number than the one used for the 'COMP' resource). This is the default.
Return -1 if you want an auto pmap (very rarely needed)

Each implementation MUST always return the same value !

Reimplemented from TBasicDataExchanger.

virtual boolean MCCOMAPI TBasicModule::GetToolDropCandidate | ( | IMFDropCandidate ** | outDropCandidate,
|  | int32 | inToolID,
|  | IMFToolbarPart * | inToolbarPart |
| ) |  |  | `[virtual]`

Implements IMFExResponder.

virtual MCCOMErr MCCOMAPI TBasicModule::HandleEvent | ( | MessageID | message,
|  | IMFResponder * | source,
|  | void * | data |
| ) |  |  | `[virtual]`

Deprecated:
  (doesn't work with multiple selections)

Reimplemented from TBasicDataExchanger.

virtual boolean MCCOMAPI TBasicModule::HaveSubModuleActive | ( |  | ) | `[inline, virtual]`

Returns true if this master module have a sub module active.

Implements I3DExModule.

virtual MCCOMErr MCCOMAPI TBasicModule::Hydrate | ( |  | ) | `[virtual]`

Hydrate() is called when the module is to be hydrated; that is, the room that it occupies is entered. If this module is a main module (i.e., it defines a room), override this function to show any main windows and call Hydrate() on slave modules. If this module is a slave module, override this function to prepare to be activated and call Hydrate() on any subslave modules. This may involve showing windows, but should not install parts in shared windows since Hydrate() does not mean the module is active (see Activate() below). Also note that your window may have been closed by someone else (in this case you had been told thru AboutToCloseMainWindow), so you will have to recreate your window.

Implements I3DExModule.

virtual MCCOMErr MCCOMAPI TBasicModule::Import | ( | IMCUnknown * | inElement,
|  | void * | inImportData |
| ) |  |  | `[virtual]`

Import() is called when the module is asked to import some foreign data. For example, a modeler could be asked to import the facets of another primitive. It is up to the module to do something or not with 'inElement'. The module should rely on inElement->QueryInterface to decide if it can do anything with it of not. In any case, 'inElement' should be left intact. 'inImportData' points to some data block depending on the type import. For example, for modelers, 'inImportData' will be a real32* containing the Fidelity.

Implements I3DExModule.

virtual MCCOMErr MCCOMAPI TBasicModule::Initialize | ( | IMCUnknown * | inElement | ) | `[virtual]`

Initialize() is called during creation of the module to initialize UI elements, and set the editing element. inElement is the element that the module edits. Override this function to create UI elements such as windows and initialize any data for your module.

Use QueryInterface on the inElement object to get the specific interface you need. Scene Document Modules will get an I3DShGroup object.

Modelers get two calls to Initialize. First, they get passed the universe group as all Scene Document Modules do. Next, they get passed the master object in the scene selection which they are to edit. In addition, if the user leaves the modeling room and re-enters with a different object selected, Initialize is called again with the new object to edit.

Global Modules do not get any object, the have a NULL inElement.

Implements I3DExModule.

virtual boolean MCCOMAPI TBasicModule::IsEqual | ( | IExDataExchanger * | otherDataExchanger | ) | `[virtual]`

Returns true if the two pointers are referring to the same data exchanger. When IsEqual is called you can assume that otherDataExchanger is of the same type as "this"

Parameters:

  | otherDataExchanger | the extension to which it will be compared

Reimplemented from TBasicDataExchanger.

virtual boolean MCCOMAPI TBasicModule::IsToolBarActive | ( | int32 | toolBarIndex | ) | `[inline, virtual]`

Returns true if the toolbar is active.

Parameters:

  | toolBarIndex | The index of the toolbar (same as in GetToolBarsInfo()).

Implements I3DExModule.

virtual MCCOMErr MCCOMAPI TBasicModule::QueryInterface | ( | const MCIID & | riid,
|  | void ** | ppvObj |
| ) |  |  | `[virtual]`

Check if the object supports a given interface and returns a pointer to that interface if it does. Note that QueryInterface will increment the reference count of the object by one if the interface is found.

Parameters:

  | riid | GUID of the interface
  | ppvObj | A pointer to the pointer being returned.

Reimplemented from TBasicDataExchanger.

virtual boolean MCCOMAPI TBasicModule::Receive | ( | int32 | message,
|  | IMFResponder * | source,
|  | void * | data |
| ) |  |  | `[virtual]`

Implements IMFExResponder.

virtual uint32 MCCOMAPI TBasicModule::Release | ( |  | ) | `[virtual]`

Decrements the reference count of the object. If the reference count reaches zero, the object is destroyed.

Implements IMCUnknown.

virtual boolean MCCOMAPI TBasicModule::SavesInNativeFormat | ( |  | ) | `[virtual]`

whether the module wants to save data in the nativefile format

Implements I3DExModule.

virtual boolean MCCOMAPI TBasicModule::SelfKeyDown | ( | TMCPlatformEvent * | event | ) | `[virtual]`

Implements IMFExResponder.

virtual void MCCOMAPI TBasicModule::SelfKeyUp | ( | TMCPlatformEvent * | event | ) | `[virtual]`

Implements IMFExResponder.

virtual boolean MCCOMAPI TBasicModule::SelfMenuAction | ( | ActionNumber | actionNumber | ) | `[virtual]`

Implements IMFExResponder.

virtual void MCCOMAPI TBasicModule::SelfPrepareMenus | ( |  | ) | `[virtual]`

Implements IMFExResponder.

virtual boolean MCCOMAPI TBasicModule::SelfToolAction | ( | int32 | inOldTool,
|  | int32 | inNewTool |
| ) |  |  | `[virtual]`

Implements IMFExResponder.

virtual MCCOMErr MCCOMAPI TBasicModule::SetParameter | ( | IDType | keyword,
|  | void * | parameter |
| ) |  |  | `[virtual]`

Sets the value of a parameter. You need to implement this method only if your object has parameters that are not inside the parameter map.

Parameters:

  | keyword | The ID of the parameter.
  | parameter | A pointer to buffer where the value of the parameter can be copied.

Reimplemented from TBasicDataExchanger.

virtual MCCOMErr MCCOMAPI TBasicModule::SubModuleAboutToBeDestroyed | ( | I3DShModule * | subModule | ) | `[virtual]`

SubModuleAboutToBeDestroyed() will be called by any sub module that is about to be destroyed, so you can react. (Note : you tell a sub module that you are its "master" by calling I3DShModule::SetMasterModule())

Implements I3DExModule.

virtual MCCOMErr MCCOMAPI TBasicModule::SubModuleAboutToBeHydrated | ( | I3DShModule * | subModule | ) | `[virtual]`

SubModuleAboutToBeHydrated() will be called by any sub module that is about to be hydrated, so you can react. (Note : you tell a sub module that you are its "master" by calling I3DShModule::SetMasterModule())

Implements I3DExModule.

virtual boolean MCCOMAPI TBasicModule::SubModuleClosedMainWindow | ( | I3DShModule * | subModule | ) | `[virtual]`

SubModuleClosedMainWindow() will be called by any sub module that have its Main Window being closed, so you can react and tell it that it is OK to commit suicide (return true). (Note : you tell a sub module that you are its "master" by calling I3DShModule::SetMasterModule())

Implements I3DExModule.

virtual boolean MCCOMAPI TBasicModule::WantsToBeInCurrentRoom | ( |  | ) | `[virtual]`

Tell if the module can be inserted in the current room.

Implements I3DExModule.

## Member Data Documentation

TMCCountedPtr<IChangeChannel> TBasicModule::fPreferencesChangeChannel`[protected]`

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

- BasicModule.h