HModelCache Class Reference

#include <HModel.h>

Inheritance diagram for HModelCache:

Inheritance graph
[legend]
Collaboration diagram for HModelCache:

Collaboration graph
[legend]
List of all members.

Public Member Functions

HFileInfoPropertyGetFileInfo ()
HAttrPropertyGetAttr ()
HModelCacheGetSiblingModelCache ()
HObjectCacheContainerGetParentObjectCacheContainer ()
IEPatchModelBuildExportModel (IEModelParms *iemp, const char *modelmapfilename)
IEPolyModelBuildExportModel (IEPolyModelParms *iemp, const char *modelmapfilename)
BOOL MergeIEModel (IEPatchModel *model, const char *name, float peaktolerance, BOOL addgroup, BOOL showprogressbar)
BOOL MergeIEModel (IEPolyModel *model, const char *name, float peaktolerance, BOOL addgroup, BOOL showprogressbar)
HModelNewInstance (HChor *)
void SetChanged (BOOL modified=TRUE)
HSplineGetHeadSpline ()
HSplineCreateSpline ()
void DeleteSpline (HSpline *spline)
BOOL AttachCPs (HCP *cp1, HCP *cp2)
BOOL AttachHook (HCP *cp1, HCP *cp2, float s)
HSplineStartSpline (Vector *p1, Vector *p2)
HCPAddCP (HCP *cp, Vector *p)
HCPInsertCP (HCP **cpuplink, HCP *cp, Vector *p)
BOOL DeleteCP (HCP **cpuplink, HCP *matchcp)
void BreakSpline (HCP *cp)
BOOL Make5PointPatch (HGroup *group)
BOOL Make5PointPatch (HCP *cp1, HCP *cp2, HCP *cp3, HCP *cp4, HCP *cp5)
void CopyExtrude (BOOL extrude, HGroupCP *grouptocopy, HGroupCP **newgroup)
 This function can perform two different operations. It can copy or extrude a group.
HSegmentCacheAddSegment (HBoneCache *parentbonecache, HBoneCache *afterbonecache, String &name, COLORREF color)
int CountBones ()
void AddToTemporaryGroup (HGroupCP *gh)
HGroupCreateGroup (const String &name)
void FindPatches ()
HPatchFindPatch (HCP *cp1, HCP *cp2, HCP *cp3, HCP *cp4)
HPatch5FindPatch (HCP *cp1, HCP *cp2, HCP *cp3, HCP *cp4, HCP *cp5)
UINT GetPatchCount ()
HPatchGetPatch (UINT index)
HPatch5GetHeadPatch5 ()
HDecalAddDecal (HClip *clipcache=NULL)
HDecalContainerGetChildDecalContainer ()
HGroupContainerGetChildGroupContainer ()
HBoneCacheContainerGetChildBoneCacheContainer ()
HLightCacheContainerGetChildLightCacheContainer ()
HSplineContainerGetChildSplineContainer ()
HRelationContainerCreateRelationContainer ()

Static Public Member Functions

static HModelCacheNew (const char *name=NULL, BOOL embedded=TRUE)

Detailed Description

Definition at line 41 of file HModel.h.


Member Function Documentation

HCP * HModelCache::AddCP HCP cp,
Vector p
 

Returns a pointer to the HCP that is created and linked to after the prevcp that is passed in. The position of the new HCP is set to the vector p. Note: NEVER use AddCP() to create a new spline. New splines must be created with StartSpline(), and subsequent HCPs should be added with AddCP();

Parameters:
cp - (prevcp) address of the HCP you are adding to.
p - position of the new HCP that is to be created.

HDecal * HModelCache::AddDecal HClip clipcache = NULL  ) 
 

Adds a Decal. Will create the "decals folder" if it doesn't exist.

Parameters:
clipcache - If NULL, a prompt will be displayed to the user.

HSegmentCache * HModelCache::AddSegment HBoneCache parentbonecache,
HBoneCache afterbonecache,
String name,
COLORREF  color
 

Creates a new bone and places it on the bones tree as child of parentbonecache and right after the afterbonecache. Will also create the HBoneCacheContainer and an HSegmentCache where controlled CPs may be added

Parameters:
parentbonecache - Parent of which the new bone will be a child. May be NULL in which case, the new bone is added at the model root level.
afterbonecache - The new bone will be added right after this bone
name - the name of the new bone
color - the color of the new bone. Use global function GetColor to get a color according to the number of bones in the model
Returns:
A pointer to a new HSegmentCache for the newly created hBoneCache.
Example:
modelcache->AddSegment(NULL, NULL, "Bone1", GetColor(modelcache->CountBones()));

See also:
HSegmentCache

void HModelCache::AddToTemporaryGroup HGroupCP gh  ) 
 

This function adds a group of control points to the model's "Untitled" temporary group. You pass in the first HGroupCP of a group to wish to add to the temporary group. This group will be selected when you exit the plugin. The group that is passed into this function will be freed.

Parameters:
gh - pointer to the first HGroupCP in the group to add to the temporary group.

BOOL HModelCache::AttachCPs HCP cp1,
HCP cp2
 

Returns whether the two attached control points create a loop. This is TRUE if cp1 and cp2 are the beginning and the end of the same spline. If a loop is created, a number of things happen. If cp2 is the first control point in the spline, the spline is reversed before the loop is made. The last control point in the spline gets deleted (make sure you keep this in mind if you are performing operations on HCPs after they are attached (check the return value to see if a loop was made). Also, the control point before the last control point has its IsLoop flag set, and its GetNext() pointer set to the first HCP in the spline. If the attach operation does not create a loop, then the two HCPs are stacked, and added to their attached control point list. They are also linked to the HCP::GetHead() which stores the position for all of the control points that are attached to each other.

Parameters:
cp1 - first control point to attach
cp2 - second control point to attach
Note:
If you use AttachCPs in such a way as to cause a loopback, be careful not to add the tail CP to any HGroup that you are accumulating, as something happens to that CP after the attach that will cause a crash if you've added it to the group.

BOOL HModelCache::AttachHook HCP cp1,
HCP cp2,
float  s
 

void HModelCache::BreakSpline HCP cp  ) 
 

IEPolyModel* HModelCache::BuildExportModel IEPolyModelParms iemp,
const char *  modelmapfilename
 

IEPatchModel* HModelCache::BuildExportModel IEModelParms iemp,
const char *  modelmapfilename
 

void HModelCache::CopyExtrude BOOL  extrude,
HGroupCP grouptocopy,
HGroupCP **  newgroup
 

This function can perform two different operations. It can copy or extrude a group.

The copy operation will take a group and duplicate the control points and splines. The extrude operation will take this a step further and add additional splines to connect the new group of points to previous one. Set the extrude flag to FALSE if you want to copy, and to TRUE if you want to extrude. The new group of control points will be at the same location and the grouptocopy, and it is up to the plugin to walk through the new points and determine their new location. The group to copy is passed in as a HGroupCP and therefore does not need to be a named group (HGroup). The first HGroupCP of the newly created group is stored in the newHGroup handle.

It is responsibility of the plugin to free the new group when it is done with it. This can be done by calling HGroupCP::Delete() from the newHGroup that is passed back to the plugin. The Duplicator wizard provides a good demonstration of how to use the CopyExtrude() function.

Parameters:
extrude - flag to tell the function to perform extrude or copy operation.
grouptocopy - pointer to first HGroupCP to perform operation on.
newgroup - handle to return address of newly created group.

int HModelCache::CountBones  ) 
 

HGroup* HModelCache::CreateGroup const String name  ) 
 

HRelationContainer* HModelCache::CreateRelationContainer  ) 
 

HSpline* HModelCache::CreateSpline  ) 
 

BOOL HModelCache::DeleteCP HCP **  cpuplink,
HCP matchcp
 

void HModelCache::DeleteSpline HSpline spline  ) 
 

HPatch5* HModelCache::FindPatch HCP cp1,
HCP cp2,
HCP cp3,
HCP cp4,
HCP cp5
 

HPatch* HModelCache::FindPatch HCP cp1,
HCP cp2,
HCP cp3,
HCP cp4
 

void HModelCache::FindPatches  ) 
 

HAttrProperty* HModelCache::GetAttr  ) 
 

HBoneCacheContainer* HModelCache::GetChildBoneCacheContainer  ) 
 

HDecalContainer* HModelCache::GetChildDecalContainer  ) 
 

HGroupContainer* HModelCache::GetChildGroupContainer  ) 
 

HLightCacheContainer* HModelCache::GetChildLightCacheContainer  ) 
 

HSplineContainer* HModelCache::GetChildSplineContainer  ) 
 

HFileInfoProperty* HModelCache::GetFileInfo  ) 
 

HPatch5* HModelCache::GetHeadPatch5  ) 
 

HSpline* HModelCache::GetHeadSpline  ) 
 

HObjectCacheContainer* HModelCache::GetParentObjectCacheContainer  ) 
 

HPatch* HModelCache::GetPatch UINT  index  ) 
 

UINT HModelCache::GetPatchCount  ) 
 

HModelCache* HModelCache::GetSiblingModelCache  ) 
 

HCP * HModelCache::InsertCP HCP **  cpuplink,
HCP cp,
Vector p
 

Returns a pointer to the new HCP that is created. This function creates a new control point at the location specified by the vector p and inserts it between cpuplink and cp. Pass in the the addresses of the two HCPs inbetween you want to insert the new HCP. This function returns NULL if the HCP allocation fails.

For instance CP1 -> CP2. Pass in &CP1 and CP2 and a new CP3 will be created in between them which results in CP1 -> CP2 -> CP3. And cpuplink will point to the new HCP.

Parameters:
cpuplink - the address of the pointer of the first HCP. Will point to the new HCP after the call.
cp - the pointer to the second HCP.
p - the position of the new control point.
Returns:
A pointer to the newly inserted CP.

BOOL HModelCache::Make5PointPatch HCP cp1,
HCP cp2,
HCP cp3,
HCP cp4,
HCP cp5
 

BOOL HModelCache::Make5PointPatch HGroup group  ) 
 

BOOL HModelCache::MergeIEModel IEPolyModel model,
const char *  name,
float  peaktolerance,
BOOL  addgroup,
BOOL  showprogressbar
 

BOOL HModelCache::MergeIEModel IEPatchModel model,
const char *  name,
float  peaktolerance,
BOOL  addgroup,
BOOL  showprogressbar
 

static HModelCache* HModelCache::New const char *  name = NULL,
BOOL  embedded = TRUE
[static]
 

HModel * HModelCache::NewInstance HChor  ) 
 

This creates a new instance of a model and associates it with the HChor. But the resulting HModel pointer is only in existance inside the plugin. To actually insert the instance into the HChor the HModel pointer must be inserted into the HChor structure with a call to HChor::InsertChild(), otherwise you can work with the newly created instance in the chor, but the instance will disapear when the plugin exits.

Example:

   HChor *chor;
   HModelCache *hmc_new;
   HModel *working = hmc_new->NewInstance(chor);
   chor->InsertChildAtTail(working,TRUE);

void HModelCache::SetChanged BOOL  modified = TRUE  ) 
 

HSpline * HModelCache::StartSpline Vector p1,
Vector p2
 

Returns a pointer to the new HSpline that is created with the two control point positions passed in. Since a legal spline must have a least two control points, you must use this function to create new splines. You can add subsequent control points with HCP::AddCP().

Parameters:
p1 - position for the first HCP in the spline.
p2 - position for the second HCP in the spline.


The documentation for this class was generated from the following files:
This A:M SDK v12.0 documentation is maintained by Hash Inc. Please address any comments concerning this documentation to AMReports. If you have any information, knowledge, or documentation to share with the A:M developer community, please post them on the Hash SDK forum.

Generated on Thu Oct 27 11:46:56 2005 with doxygen 1.4.5 written by Dimitri van Heesch, © 1997-2001