ftp.nice.ch/pub/next/developer/objc/api/intuitiv3d_API.s.tar.gz#/i3dApi/Examples/CustomObject/Co.m

This is Co.m in view mode; [Download] [Up]

/*
 * Copyright 1993 by Cub'x Systemes
 * 
 * All Rights Reserved
 *
 * Permission to use, copy, and distribute this software and its
 * documentation for the  purpose of making new intuitiv'3d modules.
 * This copyright notice must appears in all copies that you distribute.
 * The name of Cub'x Systeme should not be used in advertising or publicity
 * without specific, written prior permission. 
 * CUB'X SYSTEMES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
 * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
 * CUB'X SYSTEMES BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
 * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
 * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
 * SOFTWARE.
 */

/*****************************************************************************
 *
 *  CustomObject module
 *  -------------------
 *
 * File: Co.m
 *
 * Contents: An i3dModule subclass 
 *     
 *
 *****************************************************************************/

#import "Co.h"
#import "TorusWave.h"
#import "TeapotTop.h"
#import "TeapotBody.h"
#import "DistortedCube.h"
#import <i3d/CX3DNode.h>


@implementation Co : I3dModule
{
}

/*
 *  Returns the requested section type
 */
+ (SectionType) requestedSectionType
{
  /*
   *  Return ST3DObject if you want to see your section in the object 
   *  library or STShader if you want to see your section in the shader 
   *  library
   */
  return ST3DObject;
}

/*
 *  Fill the list with default instance of class that you want to add
 *  Theses classes should inherit of CX3DObject or CX3DShader according to
 *  the requestedSectionType return value.
 */
+ fillObjectList:(List*) aList
{
  id teapot;

  [aList addObject: [[TorusWave    alloc] init]];
  [aList addObject: [[DistortedCube alloc] init]];
  [aList addObject: [[TeapotTop    alloc] init]];
  [aList addObject: [[TeapotBody   alloc] init]];

  /*
   *  Please notice how it is possible to add a node (object group)
   *  to the list.
   */
  teapot = [[[CX3DNode alloc] init] setTitle: "Teapot"];
  [teapot addObject: [[TeapotTop alloc] init]];
  [teapot addObject: [[TeapotBody alloc] init]];
  [teapot setIconByName: "Teapot"];
  [aList addObject: teapot];
  

  return self;
}

/*
 *  This method returns the module name
 */
+ (const char*) moduleName
{
  return "Custom object";
}

/*
 *  This method returns the name of the tiff used for the unselected image
 *  of the section (This tiff should be in your bundle)
 *  Please return NULL if you don't have any image.
 */
+ (const char*) unselectedImage
{
  return "CoOff";
}

/*
 *  This method returns the name of the tiff used for the selected image of
 *  the section (This tiff should be in your bundle)
 *  Please return NULL if you don't have any image.
 */
+ (const char*) selectedImage
{
  return "CoOn";
}

@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.