Biomechanical Joint Model
 Author: Anderson Maciel

VCollide.H

Go to the documentation of this file.
00001 /************************************************************************\
00002 
00003   Copyright 1997 The University of North Carolina at Chapel Hill.
00004   All Rights Reserved.
00005 
00006   Permission to use, copy, modify and distribute this software
00007   and its documentation for educational, research and non-profit
00008   purposes, without fee, and without a written agreement is
00009   hereby granted, provided that the above copyright notice and
00010   the following three paragraphs appear in all copies.
00011 
00012   IN NO EVENT SHALL THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL
00013   HILL BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL,
00014   INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
00015   ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
00016   EVEN IF THE UNIVERSITY OF NORTH CAROLINA HAVE BEEN ADVISED OF
00017   THE POSSIBILITY OF SUCH DAMAGES.
00018 
00019 
00020   Permission to use, copy, modify and distribute this software
00021   and its documentation for educational, research and non-profit
00022   purposes, without fee, and without a written agreement is
00023   hereby granted, provided that the above copyright notice and
00024   the following three paragraphs appear in all copies.
00025 
00026   THE UNIVERSITY OF NORTH CAROLINA SPECIFICALLY DISCLAIM ANY
00027   WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00028   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00029   PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
00030   BASIS, AND THE UNIVERSITY OF NORTH CAROLINA HAS NO OBLIGATION
00031   TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
00032   MODIFICATIONS.
00033 
00034 
00035    --------------------------------- 
00036   |Please send all BUG REPORTS to:  |
00037   |                                 |
00038   |   geom@cs.unc.edu               |
00039   |                                 |
00040    ---------------------------------
00041   
00042      
00043   The authors may be contacted via:
00044 
00045   US Mail:  A. Pattekar/J. Cohen/T. Hudson/S. Gottschalk/M. Lin/D. Manocha
00046             Department of Computer Science
00047             Sitterson Hall, CB #3175
00048             University of N. Carolina
00049             Chapel Hill, NC 27599-3175
00050             
00051   Phone:    (919)962-1749
00052             
00053   EMail:    geom@cs.unc.edu
00054 
00055 \************************************************************************/
00056 
00057 /************************************************************************\
00058 Filename: VCollide.H
00059 --
00060 Description: This file declares the class - VCollide.
00061 
00062 \************************************************************************/
00063 
00064 
00065 #ifndef VCOLLIDE_H
00066 #define VCOLLIDE_H
00067 
00068 //error codes returned by VCollide API.
00069 //these are multiply defined in the files VInternal.C and VCollide.h
00070 //so, any changes to these need to be reflected in all three places.
00071 const int VC_ERR_INVALID_ID            = -4; //invalid id was passed to the
00072                                              //routine.
00073 const int VC_ERR_EMPTY_OBJECT          = -3;//EndObject called without adding
00074                                              //adding any triangles.
00075 const int VC_ERR_CALL_OUT_OF_SEQUENCE  = -2; //calls out of sequence.
00076 const int VC_ERR                       = -1; //some other error.
00077 const int VC_OK                        =  1; //No error.
00078 
00079 
00080 
00081 class VCInternal; //declared in file VInternal.h
00082 
00083 
00084 /************************************************************************
00085 Struct: VCReportType
00086 --
00087 Description: Used for reporting collisions.
00088 
00089 \************************************************************************/
00090 //multiply defined in files VInternal.C and VCollide.h
00091 #ifndef _VCREPORTTYPE
00092 #define _VCREPORTTYPE
00093 struct VCReportType
00094 {
00095   int id1, id2;
00096 };
00097 #endif
00098 
00099 
00100 /************************************************************************
00101 Class: VCollide
00102 --
00103 Description: This implements the VCollide API. This is the only class
00104              visible to the users of VCollide. It is just the
00105              user interface and hides all the implementation
00106              details. Implementation details can be found in the
00107              class VCInternal. The member functions of the class
00108              VCollide just make calls to the corresponding member
00109              functions of class VCInternal.
00110 
00111 \************************************************************************/
00112 
00113 class VCollide
00114 {
00115 private:  
00116   VCInternal *vcint;
00117   
00118 public:
00119   VCollide();             //constructor
00120   ~VCollide();            //destructor
00121   
00122   int NewObject(int *id); //create a new object in the database.
00123   int AddTri(double v1[3], double v2[3], double v3[3]); //insert the
00124                                                         //geometry .
00125   int EndObject(void);    //tell VCollide that inserting the 
00126                           //geometry is complete.
00127   int UpdateTrans(int id, double trans[4][4]);
00128                           //update the transformation matrix of
00129                           //the object.
00130   int ActivateObject(int id);          //activate for collision detection.
00131   int DeactivateObject(int id);        //deactivate from collision detection.
00132   int ActivatePair(int id1, int id2);  //activate the pair.
00133   int DeactivatePair(int id1, int id2);//deactivate the pair.
00134 
00135   int DeleteObject(int id);//delete the object from the database.
00136 
00137   int Collide(void);       //perform collision detection.
00138 
00139   int Report(int size, VCReportType *vcrep);
00140                            //report the results of collision detection.
00141 
00142 };
00143 
00144 
00145 #endif

Generated on Thu Dec 1 10:13:40 2005 for COME - Biomechanical Joint Model by  doxygen 1.4.5