TBasicModule Class Reference
[Base Classes for plugins]

Inheritance diagram for TBasicModule:

TBasicDataExchanger IMFExResponder I3DExModule IChangeListener TBasicUnknown IMCUnknown IMCUnknown IMCUnknown IMCUnknown List of all members.

Public Member Functions

virtual MCCOMErr MCCOMAPI QueryInterface (const MCIID &riid, void **ppvObj)
virtual uint32 MCCOMAPI AddRef ()
virtual void MCCOMAPI Clone (IExDataExchanger **, 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 ()
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 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 MCCOMErr MCCOMAPI AboutToCloseMainWindow ()
virtual boolean MCCOMAPI SavesInNativeFormat ()
 whether the module wants to save data in the nativefile format
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 void MCCOMAPI DataChanged (IChangeChannel *channel, IDType changeKind, IMCUnknown *changedData)
virtual void MCCOMAPI BecameFirstResponder (boolean on)

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 TBasicUnknown.

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

Implements IMFExResponder.

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

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

Implements I3DExModule.

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

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 MCCOMErr MCCOMAPI TBasicModule::ExtensionDataChanged (   )  [virtual]
 

Reimplemented from TBasicDataExchanger.

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

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::GetParameter (  IDType  keyword,
void *  parameter
)  [virtual]
 

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]
 

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]
 

Reimplemented from TBasicDataExchanger.

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]
 

Reimplemented from TBasicDataExchanger.

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 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]
 

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:
Generated on Mon Mar 14 12:29:07 2005 for Carrara SDK Doc by  doxygen 1.3.9.1