TBasicPrimitive Class Reference
[Base Classes for plugins]

Inheritance diagram for TBasicPrimitive:

TBasicDataExchanger I3DExGeometricPrimitive TBasicUnknown IMCUnknown IMCUnknown List of all members.

Public Member Functions

 TBasicPrimitive ()
virtual ~TBasicPrimitive ()
virtual MCCOMErr MCCOMAPI QueryInterface (const MCIID &riid, void **ppvObj)
virtual uint32 MCCOMAPI AddRef ()
virtual void *MCCOMAPI GetExtensionDataBuffer ()
virtual MCCOMErr MCCOMAPI EnumPatches (EnumPatchesCallback callback, void *privData, boolean &closed)
virtual MCCOMErr MCCOMAPI GetNbrLOD (int16 &nbrLod)
virtual MCCOMErr MCCOMAPI GetLOD (int16 lodIndex, real &lod)
virtual MCCOMErr MCCOMAPI GetFacetMesh (uint32 lodIndex, FacetMesh **outMesh)
virtual MCCOMErr MCCOMAPI GetFacetMesh (real lod, FacetMesh **outMesh)
virtual boolean MCCOMAPI CanBeSplit ()
virtual MCCOMErr MCCOMAPI SplitPrimitive (TMCCountedPtrArray< I3DExGeometricPrimitive > &subParts, TMCArray< TTransform3D > &subPartPositions)
virtual uint32 MCCOMAPI GetUVSpaceCount ()
virtual MCCOMErr MCCOMAPI GetUVSpace (uint32 uvSpaceID, UVSpaceInfo *uvSpaceInfo)
virtual MCCOMErr MCCOMAPI UV2XYZ (TVector2 *uv, uint32 uvSpaceID, TVector3 *resultPosition, boolean *inUVSpace)
virtual MCCOMErr MCCOMAPI GetUVSpaceRDS5 (uint32 uvSpaceID, UVSpaceInfoRDS5 *uvSpaceInfo)
virtual MCCOMErr MCCOMAPI AppendToRenderables (const TTransform3D &worldFromModelTfm, TRenderableAndTfmArray &renderableAndTfm)
virtual boolean MCCOMAPI AutoSwitchToModeler () const
virtual boolean MCCOMAPI IsBBoxPickable () const
virtual boolean MCCOMAPI IsExcludedFromTripleBuffer ()
virtual void MCCOMAPI GetDefaultShader (I3DShShader **shader)
virtual void MCCOMAPI ChangedData ()

Protected Member Functions

virtual real GetFidelity ()
virtual void GetMinMaxLOD (real &minLOD, real &maxLOD)

Detailed Description

Basic Primitive class. Derive from this for a default implementation of I3DExGeometricPrimitive
See also:
I3DExGeometricPrimitive


Constructor & Destructor Documentation

TBasicPrimitive::TBasicPrimitive (   ) 
 

virtual TBasicPrimitive::~TBasicPrimitive (   )  [virtual]
 


Member Function Documentation

virtual uint32 MCCOMAPI TBasicPrimitive::AddRef (   )  [inline, virtual]
 

Increments the reference count of the object

Reimplemented from TBasicUnknown.

virtual MCCOMErr MCCOMAPI TBasicPrimitive::AppendToRenderables (  const TTransform3D &  worldFromModelTfm,
TRenderableAndTfmArray &  renderableAndTfm
)  [virtual]
 

Appends the renderable to the renderable array. This is used to append extra renderables on top of the geometry itself.

Parameters:
worldFromModelTfm The global transform of the primitive.
renderableAndTfm The array of renderable and transforms.

Implements I3DExGeometricPrimitive.

virtual boolean MCCOMAPI TBasicPrimitive::AutoSwitchToModeler (   )  const [virtual]
 

Returns true if the primitive should be open in its modeler immediately after its insertion

Implements I3DExGeometricPrimitive.

virtual boolean MCCOMAPI TBasicPrimitive::CanBeSplit (   )  [virtual]
 

Returns true if the primitive can split itself into sub parts of the same type.

Implements I3DExGeometricPrimitive.

virtual void MCCOMAPI TBasicPrimitive::ChangedData (   )  [inline, virtual]
 

Do not use. Temporary call.

Implements I3DExGeometricPrimitive.

virtual MCCOMErr MCCOMAPI TBasicPrimitive::EnumPatches (  EnumPatchesCallback  callback,
void *  privData,
boolean &  closed
)  [virtual]
 

Returns the primitive as a list of bicubic patches. It is recommended to use GetFacetMesh() instead.

Parameters:
callback Callback procedure that should be called for each Patch generated by the Primitive.
privData Points to private data from the Shell. Pass this pointer to callback.
closed Returns True when the surface is closed. This helps set the backface mask correctly.

Implements I3DExGeometricPrimitive.

virtual void MCCOMAPI TBasicPrimitive::GetDefaultShader (  I3DShShader **  shader  )  [virtual]
 

Returns the default shader for this primitive. This is called each time a primitive is inserted in a scene without a shader

Returns:
A pointer to the shader that should be used for this primitive (NULL to use the default master shader)

Implements I3DExGeometricPrimitive.

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

Reimplemented from TBasicDataExchanger.

virtual MCCOMErr MCCOMAPI TBasicPrimitive::GetFacetMesh (  real  lod,
FacetMesh **  outMesh
)  [virtual]
 

Never implement that one, reserved for future use (primitives with an infinite number of resolutions)

Implements I3DExGeometricPrimitive.

virtual MCCOMErr MCCOMAPI TBasicPrimitive::GetFacetMesh (  uint32  lodIndex,
FacetMesh **  outMesh
)  [virtual]
 

Returns the Facet Mesh for this lod index.

Parameters:
lodIndex The index of the level of detail that is asked (see GetNbrLOD())
outMesh A pointer to a pointer that should be set to point on the FacetMesh.

Implements I3DExGeometricPrimitive.

virtual real TBasicPrimitive::GetFidelity (   )  [protected, virtual]
 

virtual MCCOMErr MCCOMAPI TBasicPrimitive::GetLOD (  int16  lodIndex,
real &  lod
)  [virtual]
 

Return the floating point value of the level of detail that corresponds to the 0-based 'lodIndex'. (lodIndex=0 means highest resolution)

Parameters:
lodIndex The index of the level of detail
lod The returned lod precision.

Implements I3DExGeometricPrimitive.

virtual void TBasicPrimitive::GetMinMaxLOD (  real &  minLOD,
real &  maxLOD
)  [protected, virtual]
 

virtual MCCOMErr MCCOMAPI TBasicPrimitive::GetNbrLOD (  int16 &  nbrLod  )  [virtual]
 

Returns the number of levels of detail (lod) of the primitive. This value is used to determine the lodIndex in GetLOD().

Parameters:
nbrLod The number returned for the levels of detail for the primitive.
Note:
: Read the technical explanations in BasicPrimitive.cpp to learn everything about LOD (Level Of Details) management, and multi-resolution support.

Implements I3DExGeometricPrimitive.

virtual MCCOMErr MCCOMAPI TBasicPrimitive::GetUVSpace (  uint32  uvSpaceID,
UVSpaceInfo *  uvSpaceInfo
)  [virtual]
 

Returns the information regarding a particular uvSpace (= shading domain).

Parameters:
uvSpaceID The ID of the uvspace (0 based index)
uvSpaceInfo A pointer to a structure where the information will be stored.

Implements I3DExGeometricPrimitive.

virtual uint32 MCCOMAPI TBasicPrimitive::GetUVSpaceCount (   )  [virtual]
 

Returns the number of UV space on the primitives.

Implements I3DExGeometricPrimitive.

virtual MCCOMErr MCCOMAPI TBasicPrimitive::GetUVSpaceRDS5 (  uint32  uvSpaceID,
UVSpaceInfoRDS5 *  uvSpaceInfo
)  [virtual]
 

Returns the information regarding a particular uvSpace (= shading domain). To be implemented only if your primitive existed in RDS 5 or earlier, so that UV spaces can be mapped properly to the new 0..1 boundaries

Parameters:
uvSpaceID The ID of the uvspace (0 based index)
uvSpaceInfo A pointer to a structure where the information will be stored.

Implements I3DExGeometricPrimitive.

virtual boolean MCCOMAPI TBasicPrimitive::IsBBoxPickable (   )  const [inline, virtual]
 

Returns true if the primitive can be picked in the 3D View when clicking on its bounding box. Usually, you want to reply no, since the picking is done thru a ray-tracing hit test. However, some primitives such as volumic primitives or particles systems may want to answer yes. Default implementation in TBasicPrimitive returns false.

Implements I3DExGeometricPrimitive.

virtual boolean MCCOMAPI TBasicPrimitive::IsExcludedFromTripleBuffer (   )  [inline, virtual]
 

Return true if its instances should be excluded from the triple buffer (eg used for skinning)

Implements I3DExGeometricPrimitive.

virtual MCCOMErr MCCOMAPI TBasicPrimitive::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 MCCOMErr MCCOMAPI TBasicPrimitive::SplitPrimitive (  TMCCountedPtrArray< I3DExGeometricPrimitive > &  subParts,
TMCArray< TTransform3D > &  subPartPositions
)  [virtual]
 

Builds a list of sub-parts of itself. 'subPartPositions' gives the relative position of each sub part in the object local coordinates. Both arrays need to be of same size.

Note: the original primitive needs to remain intact.

Parameters:
subParts An array of sub primitives.
subPartPositions For each sub primitives, its transform.

Implements I3DExGeometricPrimitive.

virtual MCCOMErr MCCOMAPI TBasicPrimitive::UV2XYZ (  TVector2 *  uv,
uint32  uvSpaceID,
TVector3 *  resultPosition,
boolean *  inUVSpace
)  [virtual]
 

Returns the position in 3D of a point given a set of UV coordinates. This is useful if you want to calculate a UV texture from a 3D shaders for instance.

Returns:
MC_S_OK if it is implemented, E_NOTIMPL if it isn't (in which case a default implementation will be used by the shell).
Parameters:
uv The uv coordinates used as input
uvSpaceID The uv space ID to which this uv coordinates corresponds
resultPosition The 3D Position that is returned.
inUVSpace Returns true if the point was found in the upSpaceID specified.

Implements I3DExGeometricPrimitive.


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