Functions



Q3Bitmap_Empty

TQ3Status  
Q3Bitmap_Empty (
    TQ3Bitmap                     *bitmap
);

Release the memory used by a TQ3Bitmap.

Should be used to release the data used by TQ3Bitmaps returned by Quesa. You should not call Q3Bitmap_Empty on TQ3Bitmaps whose image data was allocated by you.

Parameters

NameDescription
bitmapThe TQ3Bitmap whose image data should be released.
Result: Success or failure of the operation.

Q3Bitmap_GetImageSize

TQ3Uns32  
Q3Bitmap_GetImageSize (
    TQ3Uns32                      width,
    TQ3Uns32                      height
);

Determine how much image data would be required for a TQ3Bitmap.

Returns the smallest block of memory that could hold a bitmap with the specified dimensions.

Parameters

NameDescription
widthThe proposed width of the bitmap.
heightThe proposed height of the bitmap.
Result: The number of bytes needed for the bitmap.

Q3Exit

TQ3Status  
Q3Exit (
    void
);

Shuts down Quesa, and releases any resources allocated by the library.

Result: Success or failure of the operation.

Q3GetReleaseVersion

TQ3Status  
Q3GetReleaseVersion (
    TQ3Uns32                      *releaseRevision
);

Returns the revision of the installed Quesa software in the format of the first four bytes of a Macintosh 'vers' resource.

The four bytes contain 1) the major revision level, 2) the minor revision, 3) the development stage, and 4) the prerelease revision level, respectively. The three revision levels are each represented in binary coded decimal. The development stage can be development (0x20), alpha (0x40), beta (0x60) or release (0x80).

For example, if the revision is 1.61a23 (= 1.6.1a23), returns 0x01614023. For more information, see the description of the 'vers' resource in the book Inside Macintosh: Macintosh Toolbox Essentials.

Note that unlike QD3D, Quesa allows Q3GetReleaseVersion to be called outside of a Q3Initialize/Q3Exit block.

Parameters

NameDescription
releaseRevisionReceives the revision of Quesa.
Result: Success or failure of the operation.

Q3GetVersion

TQ3Status  
Q3GetVersion (
    TQ3Uns32                      *majorRevision,
    TQ3Uns32                      *minorRevision
);

Returns the major and minor revision levels of the installed Quesa software.

For example, if the revision is 1.6a23 (= 1.6.0a23), returns 1 as the major revision level and 6 as the minor revision level: The final 0 in the minor revision level is omitted. If the revision is 1.61a23 (= 1.6.1a23), returns 1 as the major revision level and 61 as the minor revision level.

Note that unlike QD3D, Quesa allows Q3GetVersion to be called outside of a Q3Initialize/Q3Exit block.

Parameters

NameDescription
majorRevisionReceives the major revision level of Quesa.
minorRevisionReceives the minor revision level of Quesa.
Result: Success or failure of the operation.

Q3Initialize

TQ3Status  
Q3Initialize (
    void
);

Initialises Quesa.

Only Q3IsInitialized, Q3GetVersion, and Q3GetReleaseVersion may be called before the Quesa library is initialised.

Result: Success or failure of the operation.

Q3IsInitialized

TQ3Boolean  
Q3IsInitialized (
    void
);

Tests to see if Quesa has been initialised or not.

Result: True or false as Quesa has been initialised or not.

Q3ObjectHierarchy_EmptySubClassData

TQ3Status  
Q3ObjectHierarchy_EmptySubClassData (
    TQ3SubClassData               *subClassData
);

Release the memory allocated by a previous call to Q3ObjectHierarchy_GetSubClassData.

Parameters

NameDescription
subClassDataThe sub-class data to release.
Result: Success or failure of the operation.

Q3ObjectHierarchy_GetStringFromType

TQ3Status  
Q3ObjectHierarchy_GetStringFromType (
    TQ3ObjectType                 objectClassType,
    TQ3ObjectClassNameString      objectClassString
);

Returns the class name string for a class identified by a class type.

Parameters

NameDescription
objectClassTypeThe class type of the class to locate.
objectClassStringReceives the class name string of the class.
Result: Success or failure of the operation.

Q3ObjectHierarchy_GetSubClassData

TQ3Status  
Q3ObjectHierarchy_GetSubClassData (
    TQ3ObjectType                 objectClassType,
    TQ3SubClassData               *subClassData
);

Return the immediate sub-classes of a class.

The data returned must be released with a subsequent call to Q3ObjectHierarchy_EmptySubClassData.

Parameters

NameDescription
objectClassTypeThe class type of the class to query.
subClassDataReceives the immediate sub-classes of the class.
Result: Success or failure of the operation.

Q3ObjectHierarchy_GetTypeFromString

TQ3Status  
Q3ObjectHierarchy_GetTypeFromString (
    const TQ3ObjectClassNameString      objectClassString,
    TQ3ObjectType                 *objectClassType
);

Returns the class type for a class identified by a class name string.

Parameters

NameDescription
objectClassStringThe class name of the class to locate.
objectClassTypeReceives the class type of the class.
Result: Success or failure of the operation.

Q3ObjectHierarchy_IsNameRegistered

TQ3Boolean  
Q3ObjectHierarchy_IsNameRegistered (
    const char                    *objectClassName
);

Check to see if a class is registered with Quesa.

Parameters

NameDescription
majorRevisionThe class name of the class to check.
Result: True or false as the class is registered or not.

Q3ObjectHierarchy_IsTypeRegistered

TQ3Boolean  
Q3ObjectHierarchy_IsTypeRegistered (
    TQ3ObjectType                 objectClassType
);

Check to see if a class is registered with Quesa.

Parameters

NameDescription
objectClassTypeThe class type of the class to check.
Result: True or false as the class is registered or not.

Q3Object_AddElement

TQ3Status  
Q3Object_AddElement (
    TQ3Object                     object,
    TQ3ElementType                theType,
    const void                    *data
);

Add an element to an object. Same as Q3Shape_AddElement, except that the object is not required to be a shape or set.

If the object is Shared, this operation will increment the object's edit index.

This function is not available in QD3D.

Parameters

NameDescription
objectThe object to update.
theTypeThe type of the element data.
dataThe element data.
Result: Success or failure of the operation.

Q3Object_CleanDispose

TQ3Status  
Q3Object_CleanDispose (
    TQ3Object                     *theObject
);

Cleanly disposes of a Quesa object.

If theObject is not NULL, invokes Q3Object_Dispose to decrement the object reference count then clears the supplied pointer to prevent stale references.

Equivalent to:

if (theObject != NULL) { Q3Object_Dispose(theObject); theObject = NULL; }

This function is not available in QD3D.

Parameters

NameDescription
theObjectThe object to dispose (may be NULL).
Result: Success or failure of the operation.

Q3Object_ClearElement

TQ3Status  
Q3Object_ClearElement (
    TQ3Object               object,
    TQ3ElementType          theType
);

Empty an object of a particular type of element. Same as Q3Shape_ClearElement, except that the object is not required to be a shape or set.

If the object is Shared, this operation will increment the object's edit index.

This function is not available in QD3D.

Parameters

NameDescription
objectThe object to update.
theTypeThe element type to remove.
Result: Success or failure of the operation.

Q3Object_ContainsElement

TQ3Boolean  
Q3Object_ContainsElement (
    TQ3Object                object,
    TQ3ElementType           theType
);

Check to see if an object contains an element of a given type. Same as Q3Shape_ContainsElement, except that the object is not required to be a shape or set.

This function is not available in QD3D.

Parameters

NameDescription
objectThe object to query.
theTypeThe type of the element data to look for.
Result: Success or failure of the operation.

Q3Object_Dispose

TQ3Status  
Q3Object_Dispose (
    TQ3Object                     object
);

Disposes of a Quesa object.

Since TQ3Objects are reference counted, this function decrements the reference count of the object. When the reference count falls to 0, the object is disposed of.

Parameters

NameDescription
objectThe object to dispose.
Result: Success or failure of the operation.

Q3Object_Duplicate

TQ3Object  
Q3Object_Duplicate (
    TQ3Object                     object
);

Duplicates a Quesa object.

Returns a new copy of the object, with a reference count of 1.

Parameters

NameDescription
objectThe object to duplicate.
Result: A new copy of the object.

Q3Object_EmptyElements

TQ3Status  
Q3Object_EmptyElements (
    TQ3Object                object
);

Empty an object of any elements it contains. Same as Q3Shape_EmptyElements, except that the object is not required to be a shape or set.

If the object is Shared, this operation will increment the object's edit index.

This function is not available in QD3D.

Parameters

NameDescription
objectThe object to update.
Result: Success or failure of the operation.

Q3Object_GetElement

TQ3Status  
Q3Object_GetElement (
    TQ3Object                     object,
    TQ3ElementType                theType,
    void                          *data
);

Get an element from an object. Same as Q3Shape_GetElement, except that the object is not required to be a shape or set.

This function is not available in QD3D.

Parameters

NameDescription
objectThe object to query.
theTypeThe type of the element data.
dataReceives the element data.
Result: Success or failure of the operation.

Q3Object_GetLeafType

TQ3ObjectType  
Q3Object_GetLeafType (
    TQ3Object                     object
);

Returns the leaf type of an object.

Returns the most specific type that can be identified from the object (e.g., a camera object may have a leaf type of kQ3CameraTypeViewAngleAspect). Returns kQ3ObjectTypeInvalid if the object type is unknown.

Parameters

NameDescription
objectThe object to test.
Result: The leaf type of the object.

Q3Object_GetNextElementType

TQ3Status  
Q3Object_GetNextElementType (
    TQ3Object                object,
    TQ3ElementType           *theType
);

Iterate through the element types in an object. Same as Q3Shape_GetNextElementType, except that the object is not required to be a shape or set.

Pass in kQ3ElementTypeNone to start iterating through the element types in the object, and pass back the returned value to obtain the next type. The type is set to kQ3ElementTypeNone if there are no more elements in the shape.

This function is not available in QD3D.

Parameters

NameDescription
objectThe object to query.
theTypeReceives the next element type.
Result: Success or failure of the operation.

Q3Object_GetSet

TQ3Status  
Q3Object_GetSet (
    TQ3Object               object,
    TQ3SetObject*			set
);

Get the element set of an object. This is not the same as the set returned by Q3Shape_GetSet.

This function is primarily for the use of file format plug-ins. Most applications will not need it.

This function is not available in QD3D.

Parameters

NameDescription
objectThe object.
setReceives a set object, or NULL.
Result: Success or failure of the operation.

Q3Object_GetType

TQ3ObjectType  
Q3Object_GetType (
    TQ3Object                     object
);

Returns the top level type of an object.

Returns kQ3ObjectTypeElement, kQ3ObjectTypePick, kQ3ObjectTypeShared, or kQ3ObjectTypeView. Returns kQ3ObjectTypeInvalid if the object type is unknown.

Parameters

NameDescription
objectThe object to test.
Result: The top level type of the object.

Q3Object_IsDrawable

TQ3Boolean  
Q3Object_IsDrawable (
    TQ3Object                     object
);

Tests to see if an object is drawable.

Only drawable objects may be submitted to a view's rendering loop.

Parameters

NameDescription
objectThe object to test.
Result: True or false as the object is drawable or not.

Q3Object_IsType

TQ3Boolean  
Q3Object_IsType (
    TQ3Object                     object,
    TQ3ObjectType                 theType
);

Tests to see if an object belongs to a given type.

Examines both the object supplied and its parents. E.g., a camera object would return true for a type of kQ3CameraTypeViewAngleAspect, kQ3ShapeTypeCamera, kQ3SharedTypeShape, and kQ3ObjectTypeShared but would return false for kQ3ObjectTypePick.

Parameters

NameDescription
objectThe object to test.
theTypeThe type to test the object against.
Result: True or false as the object belongs to the type or not.

Q3Object_IsWritable

TQ3Boolean  
Q3Object_IsWritable (
    TQ3Object                     object,
    TQ3FileObject                 theFile
);

Tests to see if an object is writable.

Only drawable objects may be submitted to a view's writing loop.

Parameters

NameDescription
objectThe object to test.
Result: True or false as the object is writable or not.

Q3Object_SetSet

TQ3Status  
Q3Object_SetSet (
    TQ3Object               object,
    TQ3SetObject			set
);

Assign to the element set of an object, disposing any previous set. This is not the same as the set element that is changed by Q3Shape_SetSet.

This function is primarily for the use of file format plug-ins. Most applications will not need it.

This function is not available in QD3D.

Parameters

NameDescription
objectThe object.
setA set object.
Result: A set object, or NULL.

Q3Object_Submit

TQ3Status  
Q3Object_Submit (
    TQ3Object                     object,
    TQ3ViewObject                 view
);

Submit an object to a view.

The object is submitted to the view's current processing loop, e.g., for rendering, picking, or writing to a file.

Parameters

NameDescription
objectThe object to submit.
viewThe view to submit the object to.
Result: Success or failure of the operation.

Q3Shape_AddElement

TQ3Status  
Q3Shape_AddElement (
    TQ3ShapeObject                shape,
    TQ3ElementType                theType,
    const void                    *data
);

Add an element to a shape.

Parameters

NameDescription
shapeThe object to update.
theTypeThe type of the element data.
dataThe element data.
Result: Success or failure of the operation.

Q3Shape_ClearElement

TQ3Status  
Q3Shape_ClearElement (
    TQ3ShapeObject                shape,
    TQ3ElementType                theType
);

Empty a shape of a particular type of element.

Parameters

NameDescription
shapeThe object to update.
theTypeThe element type to remove.
Result: Success or failure of the operation.

Q3Shape_ContainsElement

TQ3Boolean  
Q3Shape_ContainsElement (
    TQ3ShapeObject                shape,
    TQ3ElementType                theType
);

Check to see if a shape contains an element of a given type.

Parameters

NameDescription
shapeThe object to query.
theTypeThe type of the element data to look for.
Result: Success or failure of the operation.

Q3Shape_EmptyElements

TQ3Status  
Q3Shape_EmptyElements (
    TQ3ShapeObject                shape
);

Empty a shape of any elements it contains.

Parameters

NameDescription
shapeThe object to update.
Result: Success or failure of the operation.

Q3Shape_GetElement

TQ3Status  
Q3Shape_GetElement (
    TQ3ShapeObject                shape,
    TQ3ElementType                theType,
    void                          *data
);

Get an element from a shape.

Parameters

NameDescription
shapeThe object to query.
theTypeThe type of the element data.
dataReceives the element data.
Result: Success or failure of the operation.

Q3Shape_GetNextElementType

TQ3Status  
Q3Shape_GetNextElementType (
    TQ3ShapeObject                shape,
    TQ3ElementType                *theType
);

Iterate through the element types in a shape.

Pass in kQ3ElementTypeNone to start iterating through the element types in the shape, and pass back the returned value to obtain the next type. Is set to kQ3ElementTypeNone if there are no more elements in the shape.

Parameters

NameDescription
shapeThe object to query.
theTypeReceives the next element type.
Result: Success or failure of the operation.

Q3Shape_GetSet

TQ3Status  
Q3Shape_GetSet (
    TQ3ShapeObject                shape,
    TQ3SetObject                  *theSet
);

Get the set element currently associated with a shape. The function call Q3Shape_GetSet( o, &s ) is equivalent to Q3Shape_GetElement( o, kQ3ElementTypeSet, &s ).

Note that this is not the same as the attribute set of a geometry object, nor is in the internal set which holds elements on an object. That is, after adding elements or attributes to an object, this function may still return the NULL set.

Parameters

NameDescription
shapeThe object to query.
theSetReceives the set of the object, or NULL.
Result: Success or failure of the operation.

Q3Shape_GetType

TQ3ObjectType  
Q3Shape_GetType (
    TQ3ShapeObject                shape
);

Get the type of a shape object.

Returns kQ3ObjectTypeInvalid if the object is not a shape object or the type can not be determined. Returns a kQ3ShapeTypeXXXX value for shape objects.

Parameters

NameDescription
shapeThe object to test.
Result: The type of the shape object.

Q3Shape_SetSet

TQ3Status  
Q3Shape_SetSet (
    TQ3ShapeObject                shape,
    TQ3SetObject                  theSet
);

Set the set element currently associated with a shape. The function call Q3Shape_SetSet( o, s ) is equivalent to Q3Shape_SetElement( o, kQ3ElementTypeSet, &s ).

Note that this is not the same as the attribute set of a geometry object.

Parameters

NameDescription
shapeThe object to update.
theSetThe new set for the object.
Result: Success or failure of the operation.

Q3Shared_Edited

TQ3Status  
Q3Shared_Edited (
    TQ3SharedObject               sharedObject
);

Change the edit index of a shared object.

Editing a shared object will change its edit index automatically: this function is typically used for shared plug-in objects who need to indicate to Quesa that their private data has changed.

Parameters

NameDescription
sharedObjectThe object to update.
Result: Success or failure of the operation.

Q3Shared_GetEditIndex

TQ3Uns32  
Q3Shared_GetEditIndex (
    TQ3SharedObject               sharedObject
);

Get the edit index of a shared object.

An edit index is a unique number associated with a shared object, which changes each time the object is edited. By testing this number, you can determine when an object has been edited.

Parameters

NameDescription
sharedObjectThe object to query.
Result: The current edit index of the object.

Q3Shared_GetReference

TQ3SharedObject  
Q3Shared_GetReference (
    TQ3SharedObject               sharedObject
);

Increment the reference count of a shared object.

Parameters

NameDescription
sharedObjectThe object whose reference count should be incremented.
Result: The object whose reference count has been incremented.

Q3Shared_GetReferenceCount

TQ3Uns32 
Q3Shared_GetReferenceCount (
	TQ3SharedObject               sharedObject
);

Return the reference count of a shared object.

This function should be used only for debugging. If you are tempted to use it for something else, then you probably don't understand the correct way to work with reference-counted objects.

This function is not available in QD3D.

Parameters

NameDescription
sharedObjectThe object to test.
Result: Reference count.

Q3Shared_GetType

TQ3ObjectType  
Q3Shared_GetType (
    TQ3SharedObject               sharedObject
);

Get the type of a shared object.

Returns kQ3ObjectTypeInvalid if the object is not a shared object or the type can not be determined. Returns a kQ3SharedTypeXXXX value for shared objects.

Parameters

NameDescription
sharedObjectThe object to test.
Result: The type of the shared object.

Q3Shared_IsReferenced

TQ3Boolean  
Q3Shared_IsReferenced (
    TQ3SharedObject               sharedObject
);

Determine if a shared object has more than one reference to it.

Returns kQ3True if the object has more than one reference to it. Will return kQ3False if the object a reference count of one.

Parameters

NameDescription
sharedObjectThe object to test.
Result: True or false as the object has more than one reference.

Copyright © 1999-2003 Quesa Developers — last updated on 8/10/2003