All Frameworks  Class Hierarchy  This Framework  Previous  Next  Indexes

SPAfct Class VERTEX_TEMPLATE

SPAbase.ACIS_OBJECT
  |
  +---SPAkern.ENTITY
    |
    +---VERTEX_TEMPLATE
 

Usage: you must use this class as is. You should never derive it.


public class VERTEX_TEMPLATE

Creates parameter templates.

Role: This entity enables applications to request attachment of any of the following data to the nodes of a mesh provided the MESH_MANAGER is capable of handling the request.
          - coordinate data
          - normal to the surface
          - uv parameter on the surface
          - partial derivatives in u and v on the surface
          - magnitude of the partial derivatives in u and v on the surface
          - RGB color
          - transparency
          - texture
          - pointer to user defined data

Nonglobal indexed mesh managers and coordinate mesh managers create meshes on a face basis and so can be designed to attach this type of data to the nodes. Global indexed mesh managers share node data between faces and so face related information is not stored with this type of mesh manager.
By defining a default VERTEX_TEMPLATE or attaching one to a body, lump, shell, or face, the application program can request that certain data be attached to a nodes of the mesh corresponding to that entity. A particular MESH_MANAGER must honor this request by allocating storage and wherever possible initializing values for this data.
The currently active vertex template defines the data attached to a node of a polygon on a face and is the vertex template on the face, shell, lump, body, or default in that order. The only common data for all nodes is the coordinate. The normal, uv parameter, uv partial derivatives, and magnitudes of the uv partial derivatives can be calculated and stored automatically by the MESH_MANAGER if so requested. Space for the RGB color, transparency, texture, and pointer must be allocated by the MESH_MANAGER but the values must be initialized by the application program.

See also:
INDEXED_MESH_MANAGER


Constructor and Destructor Index


o VERTEX_TEMPLATE(int,parameter_token[])
C++ initialize constructor requests memory for this object and populates it with the data supplied as arguments.
o VERTEX_TEMPLATE(void*)
C++ allocation constructor requests memory for this object but does not populate it.

Method Index


o allocate_node_mapping()
Allocates an af_node_mapping.
o copy()
Copies a VERTEX_TEMPLATE.
o deletable()
Returns indication of whether this vertex template is deletable.
o extra_cells()
Returns the number of extra cells in the VERTEX_TEMPLATE.
o get_mapping()
Gets the parameter mapping for the VERTEX_TEMPLATE.
o locate(parameter_token,int&,int&)
Gets the parameter location and site of the parameter for a given token in the VERTEX_TEMPLATE.
o merge(VERTEX_TEMPLATE*)
Merges tokens from another VERTEX_TEMPLATE into this VERTEX_TEMPLATE.
o merge_owner(ENTITY*,logical)
Notifies the VERTEX_TEMPLATE that its owning ENTITY is about to be merged with given entity.
o modify(int,parameter_token[])
Changes the tokens defined in a VERTEX_TEMPLATE.
o new_instance()
Creates a new instance of the node.
o normal_defined()
Returns TRUE if the VERTEX_TEMPLATE contains a NORMAL_TOKEN.
o operator=(VERTEX_TEMPLATE&)
Implements an assignment operator, which makes a copy of a VERTEX_TEMPLATE.
o parameter_defined(parameter_token)
Determines whether the VERTEX_TEMPLATE contains the specified parameter token.
o print(FILE*)
Prints the contents of the VERTEX_TEMPLATE on the specified file.
o same(VERTEX_TEMPLATE*)
Determines if two VERTEX_TEMPLATEs are the same.
o share()
Increments a VERTEX_TEMPLATE's use count.
o split_owner(ENTITY*)
Notifies the VERTEX_TEMPLATE that its owner is about to be split into two parts.
o valid()
Determines whether the VERTEX_TEMPLATE is fully defined.

Constructor and Destructor


o VERTEX_TEMPLATE
public VERTEX_TEMPLATE(int n_tokens,
parameter_token[] tokens)
C++ initialize constructor requests memory for this object and populates it with the data supplied as arguments.

Role: Applications should call this constructor only with the overloaded new operator inherited from the ENTITY class (for example, x=new VERTEX_TEMPLATE(...)), because this reserves the memory on the heap, a requirement to support roll back and history management.

Parameters:
n_tokens
number of tokens.
tokens
tokens.
o VERTEX_TEMPLATE
public VERTEX_TEMPLATE(void* data= 0 )
C++ allocation constructor requests memory for this object but does not populate it.

Role: The allocation constructor is used primarily by restore. Applications should call this constructor only with the overloaded new operator inherited from the ENTITY class (for example, x=new VERTEX_TEMPLATE), because this reserves the memory on the heap, a requirement to support roll back and history management.
After this constructor is called, the method allocate_node_mapping must be called to create a new af_node_mapping instance.

Parameters:
data
pointer to data.

Methods


o allocate_node_mapping
public void allocate_node_mapping()
Allocates an af_node_mapping.

Role: This must be called after a new VERTEX_TEMPLATE is constructed.
o copy
public VERTEX_TEMPLATE* copy()const
Copies a VERTEX_TEMPLATE.
o deletable
public virtual logical deletable()const
Returns indication of whether this vertex template is deletable.
o extra_cells
public int extra_cells()
Returns the number of extra cells in the VERTEX_TEMPLATE.
o get_mapping
public const af_node_mapping * get_mapping()
Gets the parameter mapping for the VERTEX_TEMPLATE.
o locate
public logical locate(parameter_token token,
int& offset,
int& count)
Gets the parameter location and site of the parameter for a given token in the VERTEX_TEMPLATE.

Parameters:
token
token ID.
offset
offset of value.
count
number of cells.
o merge
public void merge(VERTEX_TEMPLATE* vertemp)
Merges tokens from another VERTEX_TEMPLATE into this VERTEX_TEMPLATE.

Parameters:
vertemp
other vertex template.
o merge_owner
public void merge_owner(ENTITY* other,
logical delete_other)
Notifies the VERTEX_TEMPLATE that its owning ENTITY is about to be merged with given entity.

Role: The application has the chance to delete or otherwise modify the attribute. After the merge, this owner will be deleted if the logical deleting owner is TRUE, otherwise it will be retained and other entity will be deleted. The default action is to do nothing. This function is supplied by the application whenever it defines a new attribute, and is called when a merge occurs.

Parameters:
other
given entity.
delete_other
deleting owner.
o modify
public void modify(int n_tokens,
parameter_token[] tokens)
Changes the tokens defined in a VERTEX_TEMPLATE.

Parameters:
n_tokens
number of tokens.
tokens
tokens.
o new_instance
public af_node_instance * new_instance()
Creates a new instance of the node.
o normal_defined
public logical normal_defined()
Returns TRUE if the VERTEX_TEMPLATE contains a NORMAL_TOKEN.
o operator=
public VERTEX_TEMPLATE& operator=( const VERTEX_TEMPLATE& vertemp)
Implements an assignment operator, which makes a copy of a VERTEX_TEMPLATE.

Parameters:
vertemp
vertex template.
o parameter_defined
public logical parameter_defined(parameter_token id)
Determines whether the VERTEX_TEMPLATE contains the specified parameter token.

Parameters:
id
token ID.
o print
public void print(FILE* fp= stderr )const
Prints the contents of the VERTEX_TEMPLATE on the specified file.

Parameters:
fp
file pointer.
o same
public logical same(VERTEX_TEMPLATE* vertemp) const
Determines if two VERTEX_TEMPLATEs are the same.

Parameters:
vertemp
vertex template.
o share
public VERTEX_TEMPLATE* share()
Increments a VERTEX_TEMPLATE's use count.
o split_owner
public void split_owner(ENTITY* new_entity)
Notifies the VERTEX_TEMPLATE that its owner is about to be split into two parts.

Role: The application has the chance to duplicate or otherwise modify the attribute. The default action is to do nothing. This function is supplied by the application whenever it defines a new attribute, and is called when a split occurs.

Parameters:
new_entity
new_entity.
o valid
public logical valid()
Determines whether the VERTEX_TEMPLATE is fully defined.

This object is included in the file: vtplate.hxx

Copyright (c) 1989-2007 by Spatial Corp. All rights reserved.