AlUniverse

Encapsulates the retrieval, data access and storage of Alias Wire Files.

Synopsis

#include <AlUniverse.h>
class AlUniverse : public AlMessage
enum AlFileType {
kUnknown, // File type is unknown and will be ignored by ::retrieve()
kWire, // Alias/Wavefront Wire File
kIges, // Initial Graphics Exchange Standard
kVdais, // Verband Der Automobilindustrie IGES Subset
kC4x, // EDS/GM format.
kJamais, // Japan Automobile Manufacturers Association IGES Subset.
kVdafs, // Verband Der Automobilindustrie Freeform Surface Interface.
kDxf, // Drawing Exchange Format
// The file types below are available only in OpenAlias.
kDes, // EDS/GM Data Exchange Standard
kTri, // Alias/Wavefront Object Separated Triangle Format
kQuad, // Alias/Wavefront Object Separated Quad Format
kProRender, // Pro/Engineer Render File Format.
kInventor, // OpenInventor Metafile Subset V1.0
kStl, // 3D Systems SLA Format
kObj, // Alias/Wavefront TAV format.
kGeo, // Alias/Wavefront Explore format.
kStyle, // Alias/Wavefront Sketch Format.
kEpsf, // Adobe Encapsulated Postscript v2.x
kIllustrator, // Illustrator Format.
kSlc // 3D Systems Slice Format.
};
// Project subdirectory types.
// These indicate the subdirectories where different types of files are
// located.
;
enum AlApplicationMode
{
kOpenModel,
kOpenAlias
};
static statusCode initialize( AlCoordinateSystem = kZUp,
boolean initProjectEnv = FALSE );
static boolean isInitialized();
static AlCoordinateSystem coordinateSystem ();
static statusCode expandFileName( char[], const char *,
AlDirectoryType directoryType );
static boolean isWireFile( const char *, char * );
static statusCode wireFileWindowSize( int &sizeX, int &sizeY );
static statusCode setWireFileWindowSize( int sizeX, int sizeY );
static AlFileType fileType( const char * );
static statusCode retrieveOptions( AlRetrieveOptions& );
static statusCode setRetrieveOptions( const AlRetrieveOptions& );
static statusCode retrieve( const char * );
static statusCode retrieveStdin();
static const char* lastWireFileRetrieved();
static statusCode store( const char *, AlDagNode* = NULL );
static statusCode storeActive( const char * );
static statusCode storeStdout();
static AlDagNode* firstDagNode();
static AlSet* firstSet();
static AlCluster* firstCluster();
static const char* currentStage( void );
static statusCode setCurrentStage( const char* );
static statusCode mergeStage( const char* );
static statusCode mergeAllStages( void );
static statusCode deleteStage( const char* );
static statusCode deleteAllStages( void );
static statusCode visibility( const char *, boolean& );
static statusCode setVisibility( const char *, boolean );
static const char* windowSource( void );
static statusCode setWindowSource( const char * );
static const char* backgroundSource( void );
static statusCode setBackgroundSource( const char * );
static statusCode renameStage( const char *, const char * );
static AlList* stageNames( void );
static statusCode createNewStage( const char * );
static statusCode createNewStage( const char *, char*& );
static statusCode retrieveStageSet( const char *,boolean );
static statusCode saveStageSet( const char *);
static statusCode setStageWireFileName( const char *, const char * );
static const char* stageWireFileName( const char * );
static AlWindow* firstWindow();
static AlWindow* currentWindow();
static AlWindow* sbdWindow();
static AlImagePlane* firstImagePlane();
static statusCode blindData( int, long&, const char*& );
static statusCode setBlindData( int, long, const char* );
static statusCode removeBlindData( int );
static AlChannel* firstChannel();
static AlChannel* nextChannel(AlChannel *);
static statusCode nextChannelD( AlChannel *);
static AlAction* firstAction();
static AlAction* nextAction(AlAction *);
static AlShader* firstShader();
static AlShader* nextShader( AlShader* );
static statusCode nextShaderD( AlShader* );
static AlEnvironment* firstEnvironment();
static statusCode deleteAll();
static statusCode redrawScreen( unsigned flags = kRedrawInactive | kRedrawActive );
static statusCode applyIteratorToImagePlanes( AlIterator*, int& );
static statusCode applyIteratorToWindows( AlIterator *, int& );
static statusCode applyIteratorToDagNodes( AlIterator *, int& );
static statusCode applyIteratorToActions( AlIterator *, int& );
static statusCode applyIteratorToChannels( AlIterator *, int& );
static statusCode applyIteratorToSets( AlIterator *, int& );
static statusCode applyIteratorToClusters( AlIterator *, int& );
static statusCode applyIteratorToShaders( AlIterator *, int& );
static statusCode writeSDLNoAnimation( const char *, boolean );
static statusCode writeSDL( const char *, boolean, double, double, double );
static statusCode frameRange(AlFrameRangeType, double&, double&, double&);
static double currentTime();
static statusCode doUpdates( boolean = TRUE );
static boolean updatesOn()
static AlApplicationMode applicationMode();
static statusCode userPrefColor( int, int&, int&, int& );
static statusCode setUserPrefColor( int, int, int, int );

Description

This is a static class in that all of its member functions are static. It provides the foundation on which to interface with Alias Wire Files (OpenModel) or with Alias directly (via LiveData).

In Alias, there is the concept of a 'stage', an independant entity thatencapsulates all the top-level information about a modeling environment. The stage effectively represents the running version of an individual Wire file. In the interactive package, stages can be controlled through the Stage Editor. The identical control also exists in the AlUniverse class, via the Stage functions. These let you switch between stages, create and destroy stages, merge stages, and alter their features.

LiveData and OpenModel use object data thatdefines, among other things, transformations, curve and surface geometry, cameras and lights. Transformations are kept in objects called "dag nodes". Dag nodes can be connected to other dag nodes to form a list of dag nodes. There are particular types of dag nodes which refer specifically to geometry, cameras, lights, or refer to another list of dag nodes to form a hierarchical structure. Together, these different types of dag nodes can be used to build a list of hierarchical structures which is collectively called a directed acyclic graph or "DAG".

The AlUniverse class gives access to the first dag node in the DAG, and from that dag node, the list of all dag nodes in the universe can be traversed.

The object data may also contain animation information on various animatable items, such as a dag node or a piece of geometry. The animation information can be accessed through the item that is animated. The AlUniverse class also gives access to animation data through global lists.

Geometry also contains shading information. Each surface or face (a particular kind of curve) contains a list of shaders. The AlUniverse class also gives access to a global list of all shaders in the universe, as well as the single environment class.

The AlUniverse class also gives access to the list of sets in the universe via the firstSet() method. Similarly, the firstCluster() method gives access to all the clusters in the universe. However, clusters are also accessible through methods in the classes that can belong to clusters (i.e. AlDagNode, AlCurveCV and AlSurfaceCV). A cluster is an object in the DAG that has a collection of dag nodes and/or CVs. The transformations in the dag nodes above the cluster are applied to the CVs in the cluster after the latter's own transformations have been applied.

AlUniverse provides base access to the ImagePlane list and the Window list through firstImagePlane, firstWindow and related functions.

Whenever a new Alias object of any kind is created, it is automatically added to the appropriate place in the universe. For example, if a dag node is created, it is traversable through the AlUniverse::firstDagNode() method. If a new animation action is created, it is accessable by walking the list of actions via AlUniverse::firstAction()/nextAction().

However, there are a few exceptions. The AlCurve, AlFace, AlSurface and AlKeyframe classes can all be created and will not be part of the universe initially. They will become part of the universe when they are added to other objects. For example, an AlCurve becomes part of the universe when its AlCurveNode is created. An AlKeyframe becomes part of the universe when its AlParamAction is created. If a class is not part of the universe, this means that if AlUniverse::store() is called, that class will not be stored. If a LiveData application exits without making an object part of the universe, then the data will be lost and wasted memory will result.

The initialize method must be called before any other AlUniverse method is called. An Alias AlObject cannot be created until the initialize method is called.

Summary

statusCode AlUniverse::doUpdates( boolean newState )

Description

The doUpdate flag is used to notify the system that you are finished performing. If this flag is true, then it is equivalent to sending out a 'geometry modified' message to the rest of the system. When the system receives the update message, then operations such as construction history etc are performed. If the previous state of the flag was FALSE and the new state is TRUE, then an update will be performed now and on each subsequent dag modification.

boolean AlUniverse::isInitialized()

Description

Returns TRUE if the initialize method has been called.

statusCode AlUniverse::initialize( AlCoordinateSystem up, boolean initProjectEnv )

Description

Initializes the Alias LiveData/OpenModel environment so that Alias object data can be retrieved, created, and/or stored. The world space coordinate system of the Universe can be oriented so that either the positive Y-axis or positive Z-axis is considered the "up" direction. This method will do nothing if called more than once. By default OpenModel applications are not aware of the Alias project environment (e.g. user_data/demo/wire etc). By passing TRUE as the second argument, the OpenModel application will become aware of the Alias project environment, expect such an environment to exist, and will use it for locating files. The .Alias* setup files will be read and processed. However, unlike Alias, when the OpenModel application starts, if the project environment does not exist, it will not be created, and the application will proceed in the default manner. Note that the arguments have no effect when initialization occurs under OpenAlias. That is, the world space coordinate system and the project environment are determined by the running Alias application.

Arguments

< up - indicates whether the y-axis (kYUp) or z-axis (kZUp) should be the up direction. If no argument is specified, the default is kZUp. This parameter has no effect when using OpenAlias.

< initProjEnv - indicates whether the OpenModel application is to be aware of the Alias project environment or not. The default if FALSE.

Return codes

sSuccess - universe initialized

sAlreadyCreated - the universe is already initialized

sInsufficientMemory - not enough memory to initialize

sFailure - could not initialize

sNoProjectEnvironment - this will be the case if initProjEnv is TRUE and Alias project environment does not exist.

AlCoordinateSystem AlUniverse::coordinateSystem()

Description

Return the current world space coordinate system of the Universe. Note that once AlUniverse::initialize has been called, or while running under OpenAlias, the coordinate system will never change during "this" session.

Return values

kYUp - positive Y-axis is "up"

kZUp - positive Z-axis is "up"

statusCode AlUniverse::expandFileName( char expandedName[], const char *fileName, AlDirectoryType directoryType )

Description

Given a filename, expand to an absolute pathname based on the file's type and Alias project environment.

Arguments

> expandedName - location to return expanded filename. The size of this array should be large enough to hold a Unix pathname.

< fileName - name of the file to locate within the project environment. Must not contain leading slashes or dots.

< directoryType - The type of project subdirectory where the file is located. (See AlUniverse.h for possible values.

Return codes

sSuccess - the fully expanded name was successfully constructed and the file exists.

sInvalidArguments - the passed filename is already absolute (contains leading '/'), or is relative (contains

leading '..'), or the directory type is invalid.

sNoProjectEnvironment - the returned path does not exist. This may be because the Alias project environment does not exist in whole or in part.

SFailure - either or both passed names were NULL.

statusCode AlUniverse::wireFileWindowSize( int &sizeX, int &sizeY )

Description

Gets the window size that was retrieved on the previous call to AlUniverse::retrieve. OpenModel wire files default to 1279x1022 if the size has not been set. This method is available only under OpenModel and fails under OpenAlias.

Return codes

sSuccess - the store size was set

sFailure - OpenAlias is in use

sInvalidArgument - sizeX <=0 or sizeY <=0

statusCode AlUniverse::setWireFileWindowSize( int sizeX, int sizeY )

Description

Sets the window size that is written to the next call of AlUniverse::store

Note that these values are changed whenever a call to AlUniverse::retrieve is called.

OpenModel wire files default to 1279x1022 if the size has not been set. This method is available only under OpenModel and fails under OpenAlias.

Return codes

sSuccess - the store size was set

sFailure - OpenAlias is in use

sInvalidArgument - sizeX <=0 or sizeY <=0

boolean AlUniverse::isWireFile( const char *fileName, char * vbuf )

Description

Determine if a file is an Alias wire file.

Return values

TRUE - the indicated file is a valid Wire file

FALSE - one of the arguments was invalid or the file was not a Wire file

AlUniverse::AlFileType AlUniverse::fileType( const char *fileName )

Description

Determine a file's type.

Arguments

< fileName - the name of the file to type check

Return values

kUnknown : File type is unknown and will be ignored by ::retrieve()

The file types listed below are available for import in both OpenModel and OpenAlias.
kWire Alias/Wavefront Wire File

kIges Initial Graphics Exchange Standard

kVdais Verband Der Automobilindustrie IGES Subset

kC4x EDS/GM format

kJamais Japan Automobile Manufacturers Association IGES Subset

kVdafs Verband Der Automobilindustrie Freeform Surface Interface

kDxf Drawing Exchange Format

kStl 3D Systems SLA Format

The file types listed below are available for import only in OpenAlias.
kDes EDS/GM Data Exchange Standard

kTri Alias/Wavefront Object Separated Triangle Format

kQuad Alias/Wavefront Object Separated Quad Format

kProRender Pro/Engineer Render File Format

kInventor OpenInventor Metafile Subset V1.0

kObj Alias/Wavefront TAV format

kGeo Alias/Wavefront Explore format

kStyleGuide Alias/Wavefront Sketch Format

kEpsf Adobe Encapsulated Postscript

kIllustrator : Illustrator Format.

kSlc 3D Systems Slice Format

statusCode AlUniverse::retrieveOptions( AlRetrieveOptions &options )

Description

Get the options used by ::retrieve().

Arguments

> options - options that ::retrieve() will use when retrieving files.

Return codes

sSuccess - the options were returned succesfully.

sInvalidArgument - 'options' was NULL.

sFailure - AlUniverse was not initialized.

statusCode AlUniverse::setRetrieveOptions( const AlRetrieveOptions &options )

Description

Set the options used by ::retrieve().

Arguments

< options - options that ::retrieve() will use when retrieving files.

Return codes

sSuccess - the options were set correctly.

sInvalidArgument - 'options' was NULL, or a parameter in 'options' was out of range.

sFailure - AlUniverse was not initialized.

statusCode AlUniverse::retrieve( const char *fileName )

Description

Retrieves an Alias Wire file and adds the objects stored in the file to the list of Alias AlDagNode objects. If fileName is NULL the file is read from stdin.

If the universe has been initialized with Y-axis up, and the wire file retrieved was stored in a Z-axis up system, or vice versa, then the model will be rotated by 90 degrees. It is best to initialize the universe in the same orientation as the wire files that will be retrieved.

Note that if sInvalidWireFile is returned you are likely trying to retrieve a newer wire file than your application recognizes. In this case you should link your application with the OpenModel library distributed with the newer Alias.

Arguments

< fileName - the name of the file to be retrieved

Return codes

sSuccess - the file was retrieved successfully

sInsufficientMemory - not enough memory

sFailure - the wire file could not be retrieved properly

sInvalidWireFile - the file was not a compatible Alias wire file.

const char* AlUniverse::lastWireFileRetrieved()

Description:

This function returns the last wire file retrieved either by the API or by Alias. Note that the file name will not change to NULL if a delete all is performed. A NULL is returned if no files have been retrieved or if the function fails.

statusCode AlUniverse::store( const char * fileName, AlDagNode* dagNode )

Description

If the AlDagNode argument is absent or NULL then this method stores all the AlObjects in the universe to a file as an Alias Wire file. If the AlDagNode argument is not NULL then only the model below the AlDagNode is stored. If the AlDagNode is in the middle of a hierarchy, the AlDagNodes above the argument will also be stored so as to preserve transformations on the model.

Arguments

fileName - the name of the file to be stored

dagNode - see description

Return codes

sSuccess - the file was stored successfully

sFailure - the wire file could not be stored properly

statusCode AlUniverse::storeActive( const char * fileName )

Description

This method allows the user to store only those objects which are on the pick list.

Arguments

fileName - the name of the file to be stored

Return codes

sSuccess - the file was stored successfully

sFailure - the wire file could not be stored properly

AlDagNode* AlUniverse::firstDagNode()

Description

Returns the first AlDagNode in the list of Alias AlDagNode objects (the DAG). NULL is returned if the list is empty.

AlSet* AlUniverse::firstSet()

Description

Returns a pointer to the first set in this universe. Returns NULL if there are no sets in this universe.

AlCluster* AlUniverse::firstCluster()

Description

Returns a pointer to the first cluster in this universe. Returns NULL if there are no clusters in this universe.

AlChannel* AlUniverse::firstChannel()

Description

This method returns the first channel in the list of all channels in the universe. This list is not in any particular order, although channels animating the same item will appear consecutively in the list. If this method returns NULL, then that means that nothing in the universe is animated.

const char* AlUniverse::currentStage( void )

Description

Returns the name of the current stage.

statusCode AlUniverse::setCurrentStage( const char* name )

Description

Switch the current stage to the stage with the indicated name

Arguments

name - the name of the stage to switch to

Return codes

sSuccess - the stage was set to the indicated stage

sFailure - the stage with the given name could not be found

statusCode AlUniverse::mergeStage( const char *name )

Description

Merges the current stage with another stage

Arguments

name - the name of the stage to merge with

Return codes

sSuccess - the stage was successfully merged

sFailure - a stage with the given name could not be found or the merge operation failed

statusCode AlUniverse::mergeAllStages( void )

Description

Merges all of the stages into a single stage. The current stage is switched to the merged stage.

Return codes

sSuccess - all of the stages were successfully merged

sFailure - the merge operation failed or there were no stages to merge

statusCode AlUniverse::deleteStage( const char *name )

Description

Deletes the stage with the given name. Under OpenAlias, this operation will not delete the last stage if there is only one stage remaining.

Arguments

name - the name of the stage to delete

Return codes

sSuccess - the stage was successfully deleted

sFailure - there was no stage with the given name or the delete operation failed

statusCode AlUniverse::deleteAllStages( void )

Description

Deletes the stage with the given name. This operation will fail if there is only one stage remaining.

Return codes

sSuccess - all of the stages were successfully merged

sFailure - there was no stage with the given name or the delete operation failed

statusCode AlUniverse::visibility( const char *name, boolean& on_or_off )

Description

Returns the visibility status of the indicated stage.

Arguments

< name - the name of the stage to examine

> on_or_off - the variable to return the status in

Return codes

sSuccess - the stage was found and its visibility status was returned

sFailure - there was no stage with the given name

statusCode AlUniverse::setVisibility( const char *name, boolean on_or_off )

Description

Sets the visibility status of the indicated stage.

Arguments

name - the name of the stage to alter

on_or_off - TRUE if the stage is visible

Return codes

sSuccess - the stage was found and its visibility status was returned

sFailure - there was no stage with the given name

const char *AlUniverse::windowSource( void )

Description

Returns the name of the currently active application window universe.

statusCode AlUniverse::setWindowSource( const char *name )

Description

Sets the window universe to the indicated stage. The window universe contains the windows you are looking through to see the objects in the current universe.

Arguments

name - the name of the stage to set the window universe to

Return codes

sSuccess - the stage was found and the window universe was set

sFailure - there was no stage with the given name

const char *AlUniverse::backgroundSource( void )

Description

Returns the name of the current background source.

statusCode AlUniverse::setBackgroundSource( const char *name )

Description

Chooses which stage to take the background source from (the environment shader) that is used for rendering.

Arguments

name - the name of the stage to use

Return codes

sSuccess - the stage was found

sFailure - there was no stage with the given name

statusCode AlUniverse::renameStage( const char* oldName, const char *newName )

Description

Renames the stage with the name 'oldName' to 'newName'. If NULL is specified for oldName, then the current stage is renamed.

Arguments

oldName - the name of the stage to rename

newName - the new name for the stage

Return codes

sSuccess - the stage was renamed

sNameChangedToUniqueOne - the stage was renamed, but the newName was altered to be unique

sInvalidArgument - the newName was NULL

sFailure - the indicated stage could not be found

AlList* AlUniverse::stageNames( void )

Description

Returns an AlList (of AlNameItems) containing the names of all of the stages that are present.

statusCode AlUniverse::createNewStage( const char* name )

Description

This routine is now OBSOLETE. Use the routine AlUniverse::createNewStage( const char*, char*&) instead.

statusCode AlUniverse::createNewStage( const char* name, char*& stagename )

Description

Creates a new stage and sets the current stage to the new stage. The name assigned to the stage is returned in stagename. Access to stagename is important when stage names are reused and a new unique name is selected. Note that stagename will be assigned to something that can change through calls in the API. So caution must be taken when using stagename in future calls.

In addition, what stagename points to must not be modified since it is internal Alias data.

Arguments

< name - the name of the stage to create

> stagename - pointer to created name

Return codes

sSuccess - a new stage with the name 'name' was created

sNameChangedToUniqueOne - a new stage was created, although the the newName was altered to be unique

sFailure - a new stage could not be created.

statusCode AlUniverse::retrieveStageSet( const char *stageSet, boolean deleteStages )

Description:

This method retrieves a stage set file.

Arguments:

> stageSet - the name of the stage set file to be retrieved

> deleteStages - if true, any existing stages will be deleted

Return codes:

sSuccess - the method succeeded in retrieving the stage set

sFailure - the method failed

sInvalidArgument - stageSet is NULL

statusCode AlUniverse::saveStageSet( const char *stageSet )

Description:

This method saves a stage set file. It saves out all of the stages and their associated wire file names.

If a stage has an associated wire file name that is NULL, this routines fails.

Arguments:

> stageSet - the name(with path) of the stage set file to be created

Return codes:

sSuccess - the method succeeded in saving the stage set

sFailure - the method failed

sInvalidArgument - stageSet is NULL

statusCode AlUniverse::setStageWireFileName( const char *stageName, const char *wireFileName )

Description:

This method sets the wire file name that is to be used for the stage when the stage set is written out using the saveStageSet() call.

Note that this function will change the default name of the wire file in the store and retrieve dialog boxes in Alias.

Arguments:

> stageName - the name of the stage

> wireFileName - the name of the wire file

Return codes:

sSuccess - the method succeeded in setting the wire file for the stage

sFailure - not a valid stage name or the setting of the wire file name failed

sInvalidArgument - stageSet or wireFileName are NULL

const char* AlUniverse::stageWireFileName( const char *stageName )

Description:

This method returns the wire file name of stage 'stageName' NULL is returned if the wire file is not set or if an error occurred.

Arguments:

> stageName - the name of the stage

AlWindow *AlUniverse::firstWindow( void )

Description

Returns the first window layer.

statusCode AlUniverse::applyIteratorToWindows( AlIterator *iter, int& rc )

Description

Applies an iterator to each window.

Arguments

< iter - the iterator to apply

> rc - the return value of the last application of the iterator

Return codes

sSuccess - the iterator was successfully applied to each window

sInvalidArgument - 'iter' was NULL

AlImagePlane* AlUniverse::firstImagePlane( void )

Description

Returns the first image plane.

statusCode AlUniverse::applyIteratorToImagePlanes( AlIterator* iter, int& rc )

Description

Applies an iterator to each image plane.

Arguments

< iter - the iterator to apply

> rc - the return value of the last application of the iterator

Return codes

sSuccess - the iterator was successfully applied to each image plane

sInvalidArgument - 'iter' was NULL

AlWindow* AlUniverse::currentWindow( void )

Description

Returns the currently active window.

AlWindow* AlUniverse::sbdWindow( void )

Description

Returns the current SBD window.

statusCode AlUniverse::blindData( int type, long& size, const char*& ptr )

Description

Retrieves the blind data for the universe. If there is no data, the size will be 0 and the pointer will be NULL.

NOTE: If two universes both containing blind data are merged then the resulting universe will have blind data for both universes. If there are two blind data packets with the same "type" only the first one will ever be retrieved by this method. To get at the second one, the first must be deleted (the data can be stored before deleting the blind data). The order of the blind data is indeterminate!

Arguments

< type - the blind data type to find

> size - the size of the blind data if found

> ptr - a pointer to the blind data if found

Return codes

sSuccess - the blind data type was found

sFailure - the blind data type was not found

statusCode AlUniverse::setBlindData( int type, long size, const char* ptr )

Description

Associates a block of data with the object. If a block of data is already associated with this object and this user_type, the old block is replaced by a reference to the new block. The old block of data is not deleted.

Arguments

type - the type of the blind data to set

size - the size of the blind data

ptr - a pointer to the blind data

Return codes

sSuccess - the blind data was set

statusCode AlUniverse::removeBlindData( int type )

Description

Removes the blind data from the universe with the indicated type. Note that the user is still responsible for the memory associated with this block of data.

Arguments

type - the blind data type to remove

Return codes

sSuccess - the type was found and removed

sFailure - the indicated type could not be found

AlChannel* AlUniverse::nextChannel(AlChannel *curChannel )

Description

This method returns the next channel in the global list of all channels that appears after the given channel 'curChannel'.

Arguments

< curChannel - the channel in the list to obtain the next channel from

statusCode AlUniverse::nextChannelD(AlChannel *curChannel )

Description

This method destructively points 'curChannel' to the next channel in the global list of all channels that appear after the given channel. sFailure is returned if there is no next channel.

Arguments

< curChannel - the channel in the list to obtain the next channel from

Return codes

sSuccess - 'curChannel' now points to the next channel

sFailure - the universe is not initialized or there is no next channel

sInvalidArgument - 'curChannel' is invalid or NULL

AlAction* AlUniverse::firstAction()

Description

This method returns the first action in the list of all actions in the universe. This list is not in any particular order, and in particular, if an action is added to or deleted from the universe, this list may be reordered. Returns NULL if there are no actions in this universe.

AlAction* AlUniverse::nextAction( AlAction *curAction )

Description

This method returns the next action in the global list of all actions that appears after the given action 'curAction'. This list is not in any particular order, and in particular, if an action is added to or deleted from the universe, this list may be reordered.

Arguments

< curAction - the action in the list to obtain the next action from

AlShader* AlUniverse::firstShader()

Description

Returns the first AlShader in the list of Alias AlShader objects. NULL is returned if the list is empty.

AlShader* AlUniverse::nextShader( AlShader* curShader )

Description

Returns the AlShader following curShader in the list of Alias AlShader objects. NULL is returned if curShader has no next shader.

Arguments

< curShader - Shader from which to walk forward

statusCode AlUniverse::nextShaderD( AlShader* curShader )

Description

Destructively points 'curShader' to the AlShader following curShader in the list of Alias AlShader objects.

Arguments

< curShader - Shader from which to walk forward

Return codes

sSuccess - curShader now points to the next shader

sFailure - there is no next shader

sInvalidArgument - curShader was invalid

AlEnvironment* AlUniverse::firstEnvironment()

Description

Returns the first AlEnvironment in the list of Alias AlEnvironment objects. NULL is returned if the list is empty.

statusCode AlUniverse::deleteAll()

Description

Deletes all objects in the universe. After this operation ALL references to ALL objects will be invalid.

Return codes

sSuccess - everything was successfully deleted.

sFailure - the universe was not initialized or the deletion failed.

statusCode AlUniverse::redrawScreen( unsigned flags )

Description

This routine redraws the modeling windows. Use it after you have completed an operation if you want to see the results. Different parts of the display can be selectively updated. These are selected by performing a bitwise OR of the flags kRedrawInactive, kRedrawActive and kRedrawTemplate. This routine succeeds in LiveData and fails in OpenModel.

Return codes

sSuccess - if it was able to redraw.

sInvalidArgument - if the flags are out of range

sFailure - if it was unable to redraw (this always occurs in OpenModel)

statusCode AlUniverse::applyIteratorToDagNodes( AlIterator* iter, int& rc )

Description

Applies an iterator to all dagnodes. This does not recursively go down the dag.

Arguments

< iter - the iterator to apply

> rc - the return value of the last application of the iterator

Return codes

sSuccess - the iterator was successfully applied to each dagNode

sInvalidArgument - 'iter' was NULL

statusCode AlUniverse::applyIteratorToActions( AlIterator* iter, int& rc )

Description

Applies an iterator to each action.

Arguments

< iter - the iterator to apply

> rc - the return value of the last application of the iterator

Return codes

sSuccess - the iterator was successfully applied to each action

sInvalidArgument - 'iter' was NULL

statusCode AlUniverse::applyIteratorToChannels( AlIterator* iter, int& rc )

Description

Applies an iterator to each channel.

Arguments

< iter - the iterator to apply

> rc - the return value of the last application of the iterator

Return codes

sSuccess - the iterator was successfully applied to each channel

sInvalidArgument - 'iter' was NULL

statusCode AlUniverse::applyIteratorToSets( AlIterator* iter, int& rc )

Description

Applies an iterator to each set.

Arguments

< iter - the iterator to apply

> rc - the return value of the last application of the iterator

Return codes

sSuccess - the iterator was successfully applied to each set

sInvalidArgument - 'iter' was NULL

statusCode AlUniverse::applyIteratorToClusters( AlIterator* iter, int& rc )

Description

Applies an iterator to each cluster.

Arguments

< iter - the iterator to apply

> rc - the return value of the last application of the iterator

Return codes

sSuccess - the iterator was successfully applied to each cluster

sInvalidArgument - 'iter' was NULL

statusCode AlUniverse::applyIteratorToShaders( AlIterator* iter, int& rc )

Description

Applies an iterator to each shader.

Arguments

< iter - the iterator to apply

> rc - the return value of the last application of the iterator

Return codes

sSuccess - the iterator was successfully applied to each shader

sInvalidArgument - 'iter' was NULL

statusCode AlUniverse::writeSDLNoAnimation( const char *filename, boolean store_active )

Arguments

< filename - the base name of the SDL file to write to (including path if appropriate)

< store_active - as described above.

Return codes

sSuccess - the file(s) was/were successfully written

sFailure - it was not possible to write the SDL file.

sInvalidArgument - the filename was NULL

statusCode AlUniverse::writeSDL( const char *filename, boolean store_active, double start, double end, double by )

Arguments

< filename - the base name of the SDL file to write to (including path if appropriate)

< store_active - as described above.

< start - the frame to start the animation at

< end - the frame to end the aniamtion at

< by - the increment to get from start to end

Return codes

sSuccess - the file(s) was/were successfully written

sFailure - it was not possible to write the SDL file.

sInvalidArgument - the filename was NULL

double AlUniverse::currentTime()

Description

When used during playback, this function returns the value of the current frame.

statusCode AlUniverse::frameRange(AlFrameRangeType rangeType, double &start, double &end, double &by)

Description

Determines the frame range for the current universe. The range type can be one of kFromPreviewWindow (gets the value from the Preview window, either kMinMax or kGlobal; based on the choice in the preview window - this is undefined for OpenModel), kMinMax (gets the actual start and end as defined by the animaiton on the objects), and kGlobal (gets the values entered by the user - again, undefined for OpenModel).

Arguments

rangeType - as described above.

start - frame at which the animation starts

end - frame at which the animation ends

by - the amount by which frames are incremented.

Return codes

sSuccess - the frame range was successfully determined.

sInvalidArgument - rangeType was not one of the legal values.

AlUniverse::AlApplicationMode AlUniverse::applicationMode()

Description

Returns the current mode that the Alias API is running in (kOpenModel or kOpenAlias). This is useful when writing code that is shared between OpenModel and OpenAlias.

statusCode AlUniverse::userPrefColor( int colorField, int &r, int &g, int &b)

Description

Returns RGB values for the given color field. Color field constants are defined in AlUserColors.h. This method always fails in OpenModel.

Arguments

< colorField - color field

> r - red RGB value

> g - green RGB value

> b - blue RGB value

Return codes

sSuccess - normal completion

sFailure - an error occurred

statusCode AlUniverse::setUserPrefColor( int colorField, int &r, int &g, int &b)

Description

Sets RGB values for the given color field. Color field constants are defined in AlUserColors.h. This method always fails in OpenModel.

Arguments

< colorField - color field

< r - red RGB value

< g - green RGB value

< b - blue RGB value

Return codes

sSuccess - normal completion

sFailure - an error occurred





aliasdocs@aw.sgi.com
Copyright © 1996, Alias|Wavefront, a Silicon Graphics Company. All rights reserved.