Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
IRS_Methods.c
/******************************************************************************\ |
Module: IRS_Methods.c |
Purpose: renderer top level QD3D metahandler functions |
Author: Sun-Inn Shih |
Copyright (C) 1993-96 Apple Computer, Inc. All rights reserved. |
\*****************************************************************************/ |
#include <stdlib.h> |
#include <stdio.h> |
#include <QD3D.h> |
#include <QD3DGeometry.h> |
#include "IRS_Methods.h" |
/*===========================================================================*\ |
* |
* Routine: PFNew() |
* |
* Comments: |
* |
\*===========================================================================*/ |
TQ3Status IRSNew( |
TQ3RendererObject pRenderer, |
irsData *irsdata, |
void *pInitData) |
{ |
(void)(pInitData); |
(void)(pRenderer); |
irsdata->filePtr = NULL; |
irsdata->scale = 300; |
irsdata->center = 300; |
return kQ3Success; |
} |
/*===========================================================================*\ |
* |
* Routine: PFDelete() |
* |
* Comments: |
* |
\*===========================================================================*/ |
void IRSDelete( |
TQ3RendererObject pRenderer, |
irsData *irsdata) |
{ |
(void)(pRenderer); |
(void)(irsdata); |
} |
/*===========================================================================*\ |
* |
* Routine: IRSStartFrame() |
* |
* Comments: |
* |
\*===========================================================================*/ |
TQ3Status IRSStartFrame( |
TQ3ViewObject pView, |
irsData *irsdata, |
TQ3DrawContextObject pQD3DDrawContext) |
{ |
if(irsdata->filePtr == NULL) |
{ |
irsdata->filePtr = fopen("IRShelloutput.ps", "w"); |
} |
fprintf(irsdata->filePtr, "%%!PS-Adobe-3.0\n"); |
fprintf(irsdata->filePtr, "0 setgray\n"); |
fprintf(irsdata->filePtr, "1 setlinecap\n"); |
fprintf(irsdata->filePtr, "1 setlinejoin\n"); |
return kQ3Success; |
} |
/*===========================================================================*\ |
* |
* Routine: IRSEndFrame() |
* |
* Comments: |
* |
\*===========================================================================*/ |
TQ3Status IRSEndFrame( |
TQ3ViewObject pView, |
irsData *irsdata, |
TQ3DrawContextObject pQD3DDrawContext) |
{ |
if(irsdata->filePtr != NULL) |
{ |
fprintf(irsdata->filePtr, "stroke\n"); |
fprintf(irsdata->filePtr, "showpage\n"); |
fclose(irsdata->filePtr); |
irsdata->filePtr = NULL; |
} |
return kQ3Success; |
} |
/*===========================================================================*\ |
* |
* Routine: IRSStartPass() |
* |
* Comments: |
* |
\*===========================================================================*/ |
TQ3Status IRSStartPass( |
TQ3ViewObject pView, |
irsData *irsdata, |
TQ3CameraObject pCamera, |
TQ3GroupObject pLightGroup) |
{ |
return kQ3Success; |
} |
/*===========================================================================*\ |
* |
* Routine: IRSEndPass() |
* |
* Comments: |
* |
\*===========================================================================*/ |
TQ3ViewStatus IRSEndPass( |
TQ3ViewObject pView, |
irsData *irsdata) |
{ |
return kQ3ViewStatusDone; |
} |
/*===========================================================================*\ |
* |
* Routine: IRSCancel() |
* |
* Comments: |
* |
\*===========================================================================*/ |
void IRSCancel( |
TQ3ViewObject pView, |
irsData *irsdata) |
{ |
(void)(pView); |
} |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-01-14