ftp.nice.ch/pub/next/developer/objc/api/intuitiv3d_API.s.tar.gz#/i3dApi/Template/CX3DObjectSubclass.m

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

/******************************************************************************* 
 *                                                                             *
 *     Project <MyGreatProject>                                                *
 *     ------------------------                                                *
 *                                                                             *
 *                                                                             *
 *     File:                                                                   *
 *                                                                             *
 *                                                                             *
 *     Creation date:                                                          *
 *                                                                             *
 *                                                                             *
 *     Contents:                                                               *
 *                                                                             *
 *                                                                             *
 *******************************************************************************/

#import "MyCX3DObject.h"

#define VERSION 001

@implementation MyCX3DObject

/*******************************************************************************
 *                                                                             *
 *                                Class methods                                *
 *                                                                             *
 *******************************************************************************/
/*
 *  This is a good idea to set a version number to your class
 *  This is useful when you have to keep a backward compatibility
 *  when reading a stream
 */
+ initialize
{
  [self setVersion: VERSION];
  return self;
}

/*
 *  ExportedVariables allows you to speedup the implementation of the read: and
 *  write: methods. Please read the documentation.
 */
+ (ExportedVariable*) exportedVariable
{
  static ExportedVariable ev[] = 
    {
      /*
       *  Describe your new instance variable here
       */
      {"MyInstanceVariableName", MyType , 0 },
      ...,
      {"",0,0}
    };
  return ev;
}

/*******************************************************************************
 *                                                                             *
 *                               Instance methods                              *
 *                                                                             *
 *******************************************************************************/
/*
 *  The init method should set some default values for your instance variables.
 */
- init
{
  [super init];

  /*
   *  Initialize your own instance variable here
   */
  return self;
}

/*
 *  The copy method should be implemented. 
 *  Duplicate the receiver.
 */
- copy
{
  MyCX3DObject *obj = [super copy];
  /*
   *  Copy your own instance variable here
   */
  return self;
}

/*
 *  This method render the object.
 *  You can use Renderman functions inside
 *  this method. You should begin this method
 *  by if( [super render] ) { ... 
 */
- render
{
  if( [super render] )
    {
      /*
       *  Use Renderman functions here
       */
    }
  return self;
}

/*
 *  This method should returns the bounding box of your instance.
 *  You have to implement this method.
 */
- getBoundingBox:(RtBound) aBox
{
  BB_MINX( aBox ) = 0.0;
  BB_MAXX( aBox ) = 0.0;
  BB_MINY( aBox ) = 0.0;
  BB_MAXY( aBox ) = 0.0;
  BB_MINZ( aBox ) = 0.0;
  BB_MAXZ( aBox ) = 0.0;
  return self;
}

/*
 *  This method returns the class of the inspector you want to use
 *  for your new object. You can return nil.
 */
- attributeInspClass
{
  return nil;
}

@end



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