Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

TK_Polyhedron Class Reference

#include <BPolyhedron.h>

Inheritance diagram for TK_Polyhedron:

Inheritance graph
[legend]
Collaboration diagram for TK_Polyhedron:

Collaboration graph
[legend]
List of all members.

Detailed Description

Base class for shell and mesh.

Shells and Meshes both have attributes that can bind to faces, edges and vertices and may optionally be present. This base class helps allows the two to share the code to parse and execute those features that are common between the two.

Definition at line 24 of file BPolyhedron.h.

Public Types

enum  Exists
enum  Face_Exists
enum  Suboptions
enum  Suboptions2
enum  Opt_Opcode

Public Member Functions

float const * GetPoints () const
float * GetPoints ()
 a pointer to the array of vertex locations
int GetPointCount () const
 the number of points in the polyhedron
unsigned int const * GetExists () const
 a pointer to the existence array, a bitmask indicating presence/absence of attributes
unsigned int * GetExists ()
 a pointer to the existence array, a bitmask indicating presence/absence of attributes
unsigned int const * GetFaceExists () const
 a pointer to the existence array for faces, mp_face_exists, indicating face attributes
unsigned int * GetFaceExists ()
 a pointer to the existence array for faces, mp_face_exists, indicating face attributes
ID_Key GetKey () const
 the id by which the graphics knows this piece of geometry (could be pointer or integer)
unsigned char GetSubop () const
 the suboption that will be transmitted to indicate formatting options
unsigned short GetSubop2 () const
 the 2nd suboption that will be transmitted to indicate formatting options
const float * GetBounding () const
 a pointer to the bounding box (x_min, y_min, z_min, x_max, y_max, z_max)
float const * GetVertexNormals () const
 a pointer to the array of vertex normals
float * GetVertexNormals ()
 a pointer to the array of vertex normals
float const * GetVertexParameters () const
 a pointer to the array of vertex parameters
float * GetVertexParameters ()
 a pointer to the array of vertex parameters
float const * GetVertexFaceColors () const
 a pointer to the array of vertex colors (as applied to the faces)
float * GetVertexFaceColors ()
 a pointer to the array of vertex colors (as applied to the faces)
float const * GetVertexEdgeColors () const
 a pointer to the array of vertex colors (as applied to the edges)
float * GetVertexEdgeColors ()
 a pointer to the array of vertex colors (as applied to the edges)
float const * GetVertexMarkerColors () const
 a pointer to the array of vertex colors (as applied to the markers)
float * GetVertexMarkerColors ()
 a pointer to the array of vertex colors (as applied to the markers)
float const * GetVertexColors () const
float * GetVertexColors ()
float const * GetVertexFaceIndices () const
 a pointer to the array of vertex colors-by-index (as applied to the faces)
float * GetVertexFaceIndices ()
 a pointer to the array of vertex colors-by-index (as applied to the faces)
float const * GetVertexEdgeIndices () const
 a pointer to the array of vertex colors-by-index (as applied to the edges)
float * GetVertexEdgeIndices ()
 a pointer to the array of vertex colors-by-index (as applied to the edges)
float const * GetVertexMarkerIndices () const
 a pointer to the array of vertex colors-by-index (as applied to the markers)
float * GetVertexMarkerIndices ()
 a pointer to the array of vertex colors-by-index (as applied to the markers)
float const * GetVertexIndices () const
float * GetVertexIndices ()
float const * GetFaceColors () const
 a pointer to the array of face colors
float * GetFaceColors ()
 a pointer to the array of face colors
float const * GetFaceIndices () const
 a pointer to the array of face colors-by-index
float * GetFaceIndices ()
 a pointer to the array of face colors-by-index
int const * GetFaceRegions () const
 a pointer to the array of face regiions
int alter * GetFaceRegions () alter
 a pointer to the array of face regions, which may be modified in-place
TK_Status SetKey (BStreamFileToolkit &tk, ID_Key key) alter
 informs the TK_Polyhedron of the id by which this piece of geometry is known
TK_Status SetSubop (unsigned char subop) alter
TK_Status SetSubop2 (unsigned short subop2) alter
TK_Status InitSubop (BStreamFileToolkit &tk, int lodlevel, bool is_firstpass) alter
TK_Status SetBounding (float const *bbox) alter
TK_Status SetPoints (int count, float const *points) alter
TK_Status SetVertexNormals (float const *normals) alter
TK_Status SetVertexParameters (float const *parameters) alter
TK_Status SetVertexFaceColors (float const *colors) alter
TK_Status SetVertexEdgeColors (float const *colors) alter
TK_Status SetVertexMarkerColors (float const *colors) alter
TK_Status SetVertexColors (float const *colors) alter
TK_Status SetVertexFaceIndices (float const *indices) alter
TK_Status SetVertexEdgeIndices (float const *indices) alter
TK_Status SetVertexMarkerIndices (float const *indices) alter
TK_Status SetVertexIndices (float const *indices) alter
TK_Status SetFaceColors (float const *colors) alter
TK_Status SetFaceIndices (float const *indices) alter
TK_Status SetFaceRegions (int const *regions=0) alter
TK_Status AppendObject (BStreamFileToolkit &tk, BBaseOpcodeHandler *obj)
BBaseOpcodeHandlerPopObject ()
bool HasOptionals ()
 true if and only if there are some attributes set on any of the faces or vertices
bool HasVertexNormals ()
 true if and only if at least one vertex normal has been set
bool HasVertexParameters ()
 true if and only if at least one vertex parameter has been set
bool HasVertexFaceColors ()
 true if and only if at least one vertex color has been set (to apply to a face)
bool HasVertexEdgeColors ()
 true if and only if at least one vertex color has been set (to apply to an edge)
bool HasVertexMarkerColors ()
 true if and only if at least one vertex color has been set (to apply to a marker)
bool HasVertexColors ()
 true if and only if at least one vertex color has been set (to apply to anything)
bool HasVertexFaceIndices () const
 true if and only if at least one vertex color-by-index has been set (to apply to a face)
bool HasVertexEdgeIndices () const
 true if and only if at least one vertex color-by-index has been set (to apply to a edge)
bool HasVertexMarkerIndices () const
 true if and only if at least one vertex color-by-index has been set (to apply to a marker)
bool HasVertexIndices () const
 true if and only if at least one vertex color-by-index has been set (to apply to anything)
bool HasFaceColors () const
 true if
bool HasFaceIndices () const
 true if and only if at least one face color-by-index has been set
bool HasFaceRegions () const
 true if and only if at least one face region has been set
bool HasFaceAttributes () const
 true if HasFaceColors() or HasFaceIndices() or HasFaceRegions()


Member Enumeration Documentation

enum TK_Polyhedron::Exists
 

Flags for declaring existance of local vertex attributes in mp_exists

Definition at line 34 of file BPolyhedron.h.

enum TK_Polyhedron::Face_Exists
 

Flags for declaring existance of local face attributes in mp_face_exists

Definition at line 50 of file BPolyhedron.h.

enum TK_Polyhedron::Opt_Opcode
 

The supported optional fields for local attributes. Note: Odd values indicate that an attribute is present on all vertices (or all faces)

Definition at line 86 of file BPolyhedron.h.

enum TK_Polyhedron::Suboptions
 

contains the meanings of the bits put into mp_subop mp_subop is a bit field containing information about the shell or mesh.

Definition at line 60 of file BPolyhedron.h.

enum TK_Polyhedron::Suboptions2
 

contains the meanings of the bits put into mp_subop2 mp_subop2 is a bit field containing information about the shell or mesh. It is assumed to be zero unless mp_subop contains the TKSH_EXPANDED bit.

Definition at line 76 of file BPolyhedron.h.


Member Function Documentation

TK_Status TK_Polyhedron::AppendObject BStreamFileToolkit tk,
BBaseOpcodeHandler obj
 

Adds an object to the set of items to be sent as part of the collection. Caller retains ownership of the object, and is responsible for deleting it during the write phase. This function automatically sets the TKSH2_COLLECTION bit, converting this shell to a collection

Parameters:
tk the toolkit
obj the object to be appended

float const* TK_Polyhedron::GetPoints void   )  const [inline]
 

Returns:
a pointer to the array of vertex locations

Reimplemented in TK_PolyCylinder.

Definition at line 124 of file BPolyhedron.h.

float* TK_Polyhedron::GetVertexColors  )  [inline]
 

Returns:
the first non-null pointer it among the following: mp_vmcolors (a.k.a. VertexMarkerColors), mp_vfcolors (a.k.a. VertexFaceColors), mp_vecolors (a.k.a. VertexEdgeColors)

Definition at line 175 of file BPolyhedron.h.

float const* TK_Polyhedron::GetVertexColors  )  const [inline]
 

Returns:
the first non-null pointer it among the following: mp_vmcolors (a.k.a. VertexMarkerColors), mp_vfcolors (a.k.a. VertexFaceColors), mp_vecolors (a.k.a. VertexEdgeColors)

Definition at line 167 of file BPolyhedron.h.

float* TK_Polyhedron::GetVertexIndices  )  [inline]
 

Returns:
the first non-null pointer it among the following: mp_vmindices (a.k.a. VertexMarkerIndices), mp_vfindices (a.k.a. VertexFaceIndices), mp_veindices (a.k.a. VertexEdgeIndices)

Definition at line 203 of file BPolyhedron.h.

float const* TK_Polyhedron::GetVertexIndices  )  const [inline]
 

Returns:
the first non-null pointer it among the following: mp_vmindices (a.k.a. VertexMarkerIndices), mp_vfindices (a.k.a. VertexFaceIndices), mp_veindices (a.k.a. VertexEdgeIndices)

Definition at line 195 of file BPolyhedron.h.

TK_Status TK_Polyhedron::InitSubop BStreamFileToolkit tk,
int  lodlevel,
bool  is_firstpass
 

initializes some bits in the suboption according to the write flags in the toolkit.

Parameters:
tk the toolkit.
lodlevel which lod variant is to be encoded.
is_firstpass indicates whether or not this particular object has been seen before in the file.

BBaseOpcodeHandler* TK_Polyhedron::PopObject  ) 
 

Pops an object off the list of collection parts.

Returns:
the object to caller (presumably so that it can be deleted)

TK_Status TK_Polyhedron::SetBounding float const *  bbox  )  [inline]
 

Set the bounding box for the object.

Parameters:
bbox the bounding volume, in order minx,miny,minz,maxx,maxy,maxz

Definition at line 237 of file BPolyhedron.h.

TK_Status TK_Polyhedron::SetFaceColors float const *  colors  ) 
 

Allocates the face colors, and fills with values and sets the flags in mp_face_exists.

Parameters:
colors can be null, in which case colors are left untouched (assumed to be specified at a later point. Normally, however, "colors" should refer to the rgb triplets for the values of the face colors. These values will be copied, and the appropriate bits in mp_face_exists will be updated.
Returns:
TK_Normal or TK_Error to indicate success or failure.

TK_Status TK_Polyhedron::SetFaceIndices float const *  indices  ) 
 

Allocates the face colors-by-index, and fills with values and sets the flags in mp_face_exists.

Parameters:
indices can be null, in which case indices are left untouched (assumed to be specified at a later point. Normally, however, "indices" should refer to the color indices (individual floats. Thus, the array size is mp_facecount*sizeof(float)). These values will be copied, and the appropriate bits in mp_face_exists will be updated.
Returns:
TK_Normal or TK_Error to indicate success or failure.

TK_Status TK_Polyhedron::SetFaceRegions int const *  regions = 0  ) 
 

Allocates an array of integers to specify a region identifier per face.

Parameters:
regions are the identifiers. If set to (or left as) null, the array will default to all zero

TK_Status TK_Polyhedron::SetPoints int  count,
float const *  points
 

Allocates the vertex locations, and fills them with the specified values. Be careful not to call this function more than once, as it can cause a memory leak.

Parameters:
count the number of points in the polyhedron
points a pointer to an array of xyz triplets to specify vertex locations.

Reimplemented in TK_PolyCylinder.

TK_Status TK_Polyhedron::SetSubop unsigned char  subop  )  [inline]
 

sets the suboption to be used when transmitting. See also InitSubop

Parameters:
subop a set of bit flags as documented in enum TK_Polyhedron::Suboptions

Definition at line 226 of file BPolyhedron.h.

TK_Status TK_Polyhedron::SetSubop2 unsigned short  subop2  )  [inline]
 

sets the 2nd suboption to be used when transmitting. See also InitSubop

Parameters:
subop2 a set of bit flags as documented in enum TK_Polyhedron::Suboptions2

Definition at line 229 of file BPolyhedron.h.

TK_Status TK_Polyhedron::SetVertexColors float const *  colors  ) 
 

Allocates the vertex colors in all 3 arrays (faces, edges, markers). Also handles setting bits in mp_exists (the existence array) if input is non-null. Equivalent to SetVertexFaceColors, SetVertexFaceColors and SetVertexMarkerColors called in succession.

Parameters:
colors can be null, in which case colors are left untouched (assumed to be specified at a later point. Normally, however, "colors" should refer to the rgb triplets for the values of the vertex colors. These values will be copied, and the appropriate bits in mp_exists will be updated.
Returns:
TK_Normal or TK_Error to indicate success or failure.

TK_Status TK_Polyhedron::SetVertexEdgeColors float const *  colors  ) 
 

Allocates the vertex colors (as applied to edges), and fills with values and sets the flags in mp_exists.

Parameters:
colors can be null, in which case colors are left untouched (assumed to be specified at a later point. Normally, however, "colors" should refer to the rgb triplets for the values of the vertex colors. These values will be copied, and the appropriate bits in mp_exists will be updated.
Returns:
TK_Normal or TK_Error to indicate success or failure.

TK_Status TK_Polyhedron::SetVertexEdgeIndices float const *  indices  ) 
 

Allocates the vertex colors-by-index (as applied to edges), and fills with values and sets the flags in mp_exists. Assumes the prior existence of a color table in the current segment.

Parameters:
indices can be null, in which case indices are left untouched (assumed to be specified at a later point. Normally, however, "indices" should refer to the color indices (individual floats. Thus, the array size is mp_pointcount*sizeof(float)). These values will be copied, and the appropriate bits in mp_exists will be updated.
Returns:
TK_Normal or TK_Error to indicate success or failure.

TK_Status TK_Polyhedron::SetVertexFaceColors float const *  colors  ) 
 

Allocates the vertex colors (as applied to faces), and fills with values and sets the flags in mp_exists.

Parameters:
colors can be null, in which case colors are left untouched (assumed to be specified at a later point. Normally, however, "colors" should refer to the rgb triplets for the values of the vertex colors. These values will be copied, and the appropriate bits in mp_exists will be updated.
Returns:
TK_Normal or TK_Error to indicate success or failure.

TK_Status TK_Polyhedron::SetVertexFaceIndices float const *  indices  ) 
 

Allocates the vertex colors-by-index (as applied to faces), and fills with values and sets the flags in mp_exists. Assumes the prior existence of a color table in the current segment.

Parameters:
indices can be null, in which case the indices are left untouched (assumed to be specified at a later point. Normally, however, "indices" should refer to the color indices (individual floats. Thus, the array size is mp_pointcount*sizeof(float)). These values will be copied, and the appropriate bits in mp_exists will be updated.
Returns:
TK_Normal or TK_Error to indicate success or failure.

TK_Status TK_Polyhedron::SetVertexIndices float const *  indices  ) 
 

Allocates the vertex colors-by-index in all 3 arrays (faces, edges, markers). Also handles setting bits in mp_exists (the existence array) if input is non-null. Equivalent to SetVertexFaceIndices, SetVertexFaceIndices and SetVertexMarkerIndices called in succession.

Parameters:
indices can be null, in which case indices are left untouched (assumed to be specified at a later point. Normally, however, "indices" should refer to the color indices (individual floats. Thus, the array size is mp_pointcount*sizeof(float)). These values will be copied, and the appropriate bits in mp_exists will be updated.
Returns:
TK_Normal or TK_Error to indicate success or failure.

TK_Status TK_Polyhedron::SetVertexMarkerColors float const *  colors  ) 
 

Allocates the vertex colors (as applied to markers), and fills with values and sets the flags in mp_exists.

Parameters:
colors can be null, in which case colors are left untouched (assumed to be specified at a later point. Normally, however, "colors" should refer to the rgb triplets for the values of the vertex colors. These values will be copied, and the appropriate bits in mp_exists will be updated.
Returns:
TK_Normal or TK_Error to indicate success or failure.

TK_Status TK_Polyhedron::SetVertexMarkerIndices float const *  indices  ) 
 

Allocates the vertex colors-by-index (as applied to markers), and fills with values and sets the flags in mp_exists. Assumes the prior existence of a color table in the current segment.

Parameters:
indices can be null, in which case indices are left untouched (assumed to be specified at a later point. Normally, however, "indices" should refer to the color indices (individual floats. Thus, the array size is mp_pointcount*sizeof(float)). These values will be copied, and the appropriate bits in mp_exists will be updated.
Returns:
TK_Normal or TK_Error to indicate success or failure.

TK_Status TK_Polyhedron::SetVertexNormals float const *  normals  ) 
 

Allocates the vertex normals, and fills with values, and sets the flags in mp_exists.

Parameters:
normals can be null, in which case normals are left untouched (assumed to be specified at a later point. Normally, however, "normals" should refer to the xyz triplets for the values of the vertex normals. These values will be copied, and the appropriate bits in mp_exists will be updated.
Returns:
TK_Normal or TK_Error to indicate success or failure.

TK_Status TK_Polyhedron::SetVertexParameters float const *  parameters  ) 
 

Allocates the vertex parameters (a.k.a. texture coordinates), and fills with values and sets mp_exists.

Parameters:
parameters can be null, in which case parameters are left untouched (assumed to be specified at a later point. Normally, however, "parameters" should refer to the stu triplets (again, triplets, not pairs) for the values of the vertex parameters. These values will be copied, and the appropriate bits in mp_exists will be updated.
Returns:
TK_Normal or TK_Error to indicate success or failure.


The documentation for this class was generated from the following file:
Generated on Tue May 17 12:06:12 2005 for Autodesk DWF 3D Toolkit by  doxygen 1.4.1