Biomechanical Joint Model
 Author: Anderson Maciel

VCollide.cpp

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.C
00059 --
00060 Description: This file implements the member functions of the class VCollide.
00061              The class VCollide is simply a user interface and and is
00062              designed for data hiding. Hence, these member functions
00063              simply return make calls to the corresponding member
00064              functions of the class VCInternal.
00065 \************************************************************************/
00066 
00067 
00068 #include "VCollide.H"
00069 #include "VCol.h"
00070 #include "VInternal.H"
00071 
00072 VCollide::VCollide()
00073 {
00074   vcint = new VCInternal;
00075 }
00076 
00077 VCollide::~VCollide()
00078 {
00079   delete vcint;
00080 }
00081 
00082 int VCollide::NewObject(int *id)    //create a new object in the database.
00083 {
00084   return vcint->NewObject(id);
00085 }
00086 
00087 int VCollide::AddTri(double v1[], double v2[], double v3[])  //insert
00088                                                              //the geometry
00089 {
00090   return vcint->AddTri(v1, v2, v3);
00091 }
00092 
00093 
00094 int VCollide::EndObject(void) //tell VCollide that inserting the 
00095                               //geometry is complete.
00096 {
00097   return vcint->EndObject();
00098 }
00099 
00100 int VCollide::UpdateTrans(int id, double t[][4])
00101   //update the transformation matrix of the object.
00102 {
00103   return vcint->UpdateTrans(id, t);
00104 }
00105 
00106 
00107 int VCollide::ActivateObject(int id)          
00108 {
00109   return vcint->ActivateObject(id);
00110 }
00111 
00112 int VCollide::DeactivateObject(int id)        
00113 {
00114   return vcint->DeactivateObject(id);
00115 }
00116 
00117 
00118 int VCollide::ActivatePair(int id1, int id2)  //activate the pair.
00119 {
00120   return vcint->ActivatePair(id1, id2);
00121 }
00122 
00123 int VCollide::DeactivatePair(int id1, int id2)//deactivate the pair.
00124 {
00125   return vcint->DeactivatePair(id1, id2);
00126 }
00127 
00128 
00129 int VCollide::DeleteObject(int id)  //delete the object from the database.
00130 {
00131   return vcint->DeleteObject(id);
00132 }
00133 
00134 
00135 int VCollide::Collide(void)         //perform collision detection.
00136 {
00137   return vcint->Collide();
00138 }
00139 
00140 
00141 int VCollide::Report(int size, VCReportType *vcrep)
00142 {                               //report the results of collision detection.
00143   return vcint->Report(size, vcrep);
00144 }
00145 
00146 
00147 
00148 //Plain C wrappers for the C++ routines:
00149 
00150 void *vcOpen(void)
00151 {
00152   return (void *)(new VCollide);
00153 }
00154 
00155 
00156 void vcClose(void *vc_handle)
00157 {
00158   delete ( (VCollide *) vc_handle );
00159 }
00160 
00161 
00162 int vcNewObject(void *vc_handle, int *id)
00163 {
00164   return ( (VCollide *)vc_handle)->NewObject(id);
00165 }
00166 
00167 int vcAddTri(void *vc_handle, double v1[], double v2[], double v3[])
00168 {
00169   return ( (VCollide *)vc_handle)->AddTri(v1, v2, v3);
00170 }
00171 
00172 int vcEndObject(void *vc_handle)
00173 {
00174   return ( (VCollide *)vc_handle)->EndObject();
00175 }
00176 
00177 int vcUpdateTrans(void *vc_handle, int id, double t[][4])
00178 {
00179   return ( (VCollide *)vc_handle)->UpdateTrans(id, t);
00180 }
00181 
00182 int vcActivateObject(void *vc_handle, int id)
00183 {
00184   return ( (VCollide *)vc_handle)->ActivateObject(id);
00185 }
00186 
00187 int vcDeactivateObject(void *vc_handle, int id)
00188 {
00189   return ( (VCollide *)vc_handle)->DeactivateObject(id);
00190 }
00191 
00192 
00193 int vcActivatePair(void *vc_handle, int id1, int id2)
00194 {
00195   return ( (VCollide *)vc_handle)->ActivatePair(id1, id2);
00196 }
00197 
00198 int vcDeactivatePair(void *vc_handle, int id1, int id2)
00199 {
00200   return ( (VCollide *)vc_handle)->DeactivatePair(id1, id2);
00201 }
00202 
00203 
00204 int vcDeleteObject(void *vc_handle, int id)
00205 {
00206   return ( (VCollide *)vc_handle)->DeleteObject(id);
00207 }
00208 
00209 int vcCollide(void *vc_handle)
00210 {
00211   return ( (VCollide *)vc_handle)->Collide();
00212 }
00213 
00214 int vcReport(void *vc_handle, int size, VCReportType *vcrep)
00215 {
00216   return ( (VCollide *)vc_handle)->Report(size, vcrep);
00217 }

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