Inherits from NGLObject3D : NSObject
Conforms to NGLIterator
NSFastEnumeration
Declared in NGLGroup3D.h

Overview

Compared to Cocoa Framework, the relation between NGLObject3D and NGLGroup3D is similar to UIView and UIWindow, respectively. The NGLGroup3D is a subclass of NGLObject3D, so it have all the properties and behavior of an NGLObject3D.

As the UIView, each NGLObject3D can have only one group at a time, but a NGLGroup3D can hold many NGLObject3D, just as an UIWindow. If you try to attach an object to a group and that object is already attached to another group, it will be automatically detached from the old one and will be attached to the new group.

Tasks

  • – initWithObjects:

    Initializes a 3d group instance with some objects attached into it. The NGLGroup3D will retain the objects internally.

  • – addObject:

    Adds a new object to this group. The group will retain the objectes internally.

  • – hasObject:

    Checks if a specific object is already attached to this group.

  • – hasObjectWithTag:

    Checks if there is at least one occurence of an object with the specified name.

  • – hasObjectWithName:

    Checks if there is at least one occurence of an object with the specified name.

  • – removeObject:

    Removes a specific object attached to this group. The objects will receive a release message when removed from group.

  • – removeObjectWithTag:

    Removes all occurences of an object with a tag. The objects will receive a release message when removed from the group.

  • – removeObjectWithName:

    Removes all occurences of an object with a name. The objects will receive a release message when removed from the group.

  • – removeAll

    Removes all objects attached to this group. All the objects will receive a release message.

  • – objectWithTag:

    Retrieves a reference of a NSObject3D in this group based on its tag. Only the first occurence of the name will be returned.

  • – objectWithName:

    Retrieves a reference of a NSObject3D in this group based on its name. Only the first occurence of the name will be returned.

  • – count

    Returns the number of object currently attached to this group.

Instance Methods

addObject:

Adds a new object to this group. The group will retain the objectes internally.

- (void)addObject:(NGLObject3D *)object

Parameters

object

A NGLObject3D to be attached to this group.

Discussion

Adds a new object to this group. The group will retain the objectes internally.

If an object is already attached to this group, new attempts to put it in the same group will be ignored. Each object can be attached to only one group. If an object already has a group, it will be detached from the old one and attached to this one.

Declared In

NGLGroup3D.h

count

Returns the number of object currently attached to this group.

- (unsigned int)count

Return Value

An int data type.

Discussion

Returns the number of object currently attached to this group.

Declared In

NGLGroup3D.h

hasObject:

Checks if a specific object is already attached to this group.

- (BOOL)hasObject:(NGLObject3D *)object

Parameters

object

A NGLObject3D to search for.

Return Value

A BOOL data type indicating if the object is attached to this group.

Discussion

Checks if a specific object is already attached to this group.

Return a BOOL indicating if the object is or not attached to this group.

Declared In

NGLGroup3D.h

hasObjectWithName:

Checks if there is at least one occurence of an object with the specified name.

- (BOOL)hasObjectWithName:(NSString *)name

Parameters

name

A NSString containing the name to search for.

Return Value

A BOOL data type indicating if the object is attached to this group.

Discussion

Checks if there is at least one occurence of an object with the specified name.

Return a BOOL indicating if the object is or not attached to this group.

Declared In

NGLGroup3D.h

hasObjectWithTag:

Checks if there is at least one occurence of an object with the specified name.

- (BOOL)hasObjectWithTag:(int)tag

Parameters

tag

An int to search for.

Return Value

A BOOL data type indicating if the object is attached to this group.

Discussion

Checks if there is at least one occurence of an object with the specified name.

Return a BOOL indicating if the object is or not attached to this group.

Declared In

NGLGroup3D.h

initWithObjects:

Initializes a 3d group instance with some objects attached into it. The NGLGroup3D will retain the objects internally.

- (id)initWithObjects:(NGLObject3D *)firstObject, ...

Parameters

firstObject

The first 3D objects (NGLObject3D) to be added, followed by a comma.

...

A list of 3D objects, all followed by commas. This method requires a nil termination.

Return Value

A new initialized instance.

Discussion

Initializes a 3d group instance with some objects attached into it. The NGLGroup3D will retain the objects internally.

This method requires nil termination.

Declared In

NGLGroup3D.h

objectWithName:

Retrieves a reference of a NSObject3D in this group based on its name. Only the first occurence of the name will be returned.

- (NGLObject3D *)objectWithName:(NSString *)name

Parameters

name

A NSString containing the name to search for.

Return Value

A NGLObject3D reference.

Discussion

Retrieves a reference of a NSObject3D in this group based on its name. Only the first occurence of the name will be returned.

Declared In

NGLGroup3D.h

objectWithTag:

Retrieves a reference of a NSObject3D in this group based on its tag. Only the first occurence of the name will be returned.

- (NGLObject3D *)objectWithTag:(int)tag

Parameters

tag

An int to search for.

Return Value

A NGLObject3D reference.

Discussion

Retrieves a reference of a NSObject3D in this group based on its tag. Only the first occurence of the name will be returned.

Declared In

NGLGroup3D.h

removeAll

Removes all objects attached to this group. All the objects will receive a release message.

- (void)removeAll

Discussion

Removes all objects attached to this group. All the objects will receive a release message.

If no object was found in this group, this method does nothing.

Declared In

NGLGroup3D.h

removeObject:

Removes a specific object attached to this group. The objects will receive a release message when removed from group.

- (void)removeObject:(NGLObject3D *)object

Parameters

object

A NGLObject3D to remove.

Discussion

Removes a specific object attached to this group. The objects will receive a release message when removed from group.

If the object is not found in this group, this method does nothing.

Declared In

NGLGroup3D.h

removeObjectWithName:

Removes all occurences of an object with a name. The objects will receive a release message when removed from the group.

- (void)removeObjectWithName:(NSString *)name

Parameters

name

A NSString containing the name to search for.

Discussion

Removes all occurences of an object with a name. The objects will receive a release message when removed from the group.

If the object is not found in this group, this method does nothing.

Declared In

NGLGroup3D.h

removeObjectWithTag:

Removes all occurences of an object with a tag. The objects will receive a release message when removed from the group.

- (void)removeObjectWithTag:(int)tag

Parameters

tag

An int to search for.

Discussion

Removes all occurences of an object with a tag. The objects will receive a release message when removed from the group.

If the object is not found in this group, this method does nothing.

Declared In

NGLGroup3D.h