Public Member Functions | Public Attributes | Protected Member Functions

SimpleObject2 Class Reference

This reference page is linked to from the following overview topics: Object Plug-ins, Lesson 5: Geometric Objects, Lesson 6: Parameter Blocks, Plug-in Base Classes, Geometric Objects, Exposing and Managing References, Writing Simple Geometric Object Plug-Ins, Creating the Mesh, Displaying the Object in the Viewport.


Search for all occurrences

Detailed Description

See also:
Class SimpleObject, Class IParamBlock2.

Description:
This class is available in release 3.0 and later only.

This version of class SimpleObject is provided for use with the parameter block 2 system. It has a public data member IParamBlock2 pblock2 used instead of the IParamBlock *pblock provided by SimpleObject. It also provides implementations of ReferenceMaker::GetReference() and SetReference() which get and set the pblock2 pointer.
Data Members:
IParamBlock2* pblock2;

Points to the ParamBlock2 instance used by this class. This is the only reference maintained by the class.

#include <simpobj.h>

Inheritance diagram for SimpleObject2:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  SimpleObject2 ()
RefTargetHandle  GetReference (int i)
  Returns the 'i-th' reference.

Public Attributes

IParamBlock2 pblock2

Protected Member Functions

virtual void  SetReference (int i, RefTargetHandle rtarg)
  Stores a ReferenceTarget as its 'i-th' reference`.

Constructor & Destructor Documentation

SimpleObject2 ( ) [inline]
{ pblock2 = NULL; }

Member Function Documentation

RefTargetHandle GetReference ( int  i ) [inline, virtual]

Returns the 'i-th' reference.

The plugin implements this method to return its 'i-th' reference. The plug-in simply keeps track of its references using an integer index for each one. This method is normally called by the system.

Parameters:
i - The index of the reference to retrieve. Valid values are from 0 to NumRefs()-1.
Returns:
The reference handle of the 'i-th' reference. Note that different calls to this method with the same 'i' value can result in different reference handles being retrieved, as the plugin changes the scene objects it references as its 'i-th' reference.

Reimplemented from SimpleObject.

{return (RefTargetHandle)pblock;}
virtual void SetReference ( int  i,
RefTargetHandle  rtarg 
) [inline, protected, virtual]

Stores a ReferenceTarget as its 'i-th' reference`.

The plugin implements this method to store the reference handle passed to it as its 'i-th' reference. In its implementation of this method, the plugin should simply assign the reference handle passed in as a parameter to the member variable that holds the 'i-th' reference. Other reference handling methods such as ReferenceMaker::DeleteReference(), or ReferenceMaker::ReplaceReference() should not be called from within this method. The plugin itself or other plugins should not call this method directly. The system will call this method when a new reference is created or an existing one is replaced by calling ReferenceMaker::ReplaceReference().

Parameters:
i - The index of the reference to store. Valid values are from 0 to NumRefs()-1.
rtarg - The reference handle to store.

Reimplemented from SimpleObject.

    {
        pblock2 = (IParamBlock2*)rtarg; 
        SimpleObject::SetReference(i, rtarg);
    }

Member Data Documentation


SimpleObject2 SimpleObject2 SimpleObject2 SimpleObject2 SimpleObject2 SimpleObject2 SimpleObject2 SimpleObject2 SimpleObject2 SimpleObject2
SimpleObject2 SimpleObject2 SimpleObject2 SimpleObject2 SimpleObject2 SimpleObject2 SimpleObject2 SimpleObject2 SimpleObject2 SimpleObject2