[SESI logo]

Prisms Development Toolkit Documentation

Side Effects Software Inc. 1997

Programmers Reference Section

Subroutines

Data Structure Manipulation Tools

valid structure types are
    POLYDETAIL  The polygon object header structure.  One per object.
    POLYPOINT   The point structure.  One per point.
    POLYGON     The polgon structure.  One per polygon.
    POLYVERTEX  The vertex structure.  One per vertex.

i - Allocate and free structures
PolyDetail * PolyDetailAlloc(void) Polygon * PolygonAlloc(void) PolyPoint * PolyPointAlloc(void) PolyVertex * PolyVertexAlloc(void) Allocate the given structure and return pointer to it. NULL is returned on error. void * PolyAlloc(int type) Allocate a structure of type 'type' and return a pointer to it. NULL is returned on error. PolyPointPointer FreePolyPoint(PolyPointPointer ptp) PolyVertexPointer FreePolyVertex(PolyVertexPointer vtp) PolygonPointer FreePolygon(PolygonPointer plp) PolyDetailPointer FreePolyDetail(PolyDetailPointer pdp) Free memory used by passed obj, return pointer to next point in list
ii - Set polygon/point data
int PolyNormal(PolyDetailPointer op) Calculate normals for polys and points in passed detail int PolyNormalP(PolygonPointer pp) Calculate normals for points in passed poly void PolyAreaNormal(PolyDetail *pdp) Calculate poly normals, scaled by area of polygon. Polys should be convex for this to work well. void PolyNum(PolyDetailPointer op) Sets the number of points, vertices and polys in the passed detail int PolyNumPoints(PolyDetailPointer op) Sets and returns the number of points in the passed detail int PolyNumPolys(PolyDetailPointer op) Sets and returns the number of polygons in the passed detail int PolyNumVertices(PolyDetailPointer op) Sets and returns the number of vertices in each poly in the passed detail int PolyNumVerticesP(PolygonPointer pp) Sets and returns the number of vertices in the passed polygon PolyInsert(int type, void *p1, void *p2) PolyDelete(int type, void *p) void PolyAddPoint(PolyPointPointer newPt, PolyDetailPointer destPdp) void PolyAddPolygon(PolygonPointer newPoly, PolyDetailPointer destPdp) Adds the single point/poly pointed to by newP to the end of destP void PolyAddDetail(PolyDetailPointer pdp1, PolyDetailPointer pdp2) Adds all points and polys of pdp2 onto end of pdp1 void PolyJoinPoints(PolyDetailPointer pdp1, PolyDetailPointer pdp2) void PolyJoinPolys(PolyDetail *pdp1, PolyDetail *pdp2) Put pdp2 list at end of pdp1 list. No new storage is created void PolyJoin(PolyDetail *pdp1, PolyDetail *pdp2) Put both points and polys lists at end of pdp1 lists

Tookit Overview
Expression Functions | User Functions | Custom SOPs
Prisms Internal Format | Programmer's Reference
Compiling SOPs | Using sopbuild | SOP Routine Reference
Dynamic SOPs | Prisms Types | Macros
Math Routines | Data Routines | Polygon Routines | Winged-edge Routines

Copyright © 1997 Side Effects Software Inc.
477 Richmond Street West, Toronto, Ontario, Canada M5V 3E7