/* -------------------- Program: ESQUI Info and Bugs: {marf,rsantana}@ctm.ulpgc.es ------------------------------------------- Copyright (c) 2006, Center for Technology in Medicine, University of Las Palmas de Gran Canaria (Canary Islands, Spain). All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the Creative Commons' "by-attribution" license (http://creativecommons.org/licenses/by/2.5). Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. =============================================================================*/ #ifndef _LIBGENERICA_v10_ #define _LIBGENERICA_v10_ ////////////////////////////////////////////// /// Aqui los ficheros de inclusion necesarios #ifdef _WIN32 #include #else #include #endif #include "Tipoherramienta.h" #include "vtkesquiColisionWin32Header.h" #include "vtkObject.h" ///////////////////////////////////////////// class vtkModeloDeformable; class vtkModeloHerramienta; class vtkModeloEstatico; class vtkOBB; class vtkEsfera; class vtkInfoColisionCollection; class vtkRenderer; #include "Macros.h" // ***** CLASES //! Se encarga de abstraer el uso de cualquier libreria de Deteccion de Colisiones al Modulo de Deteccion de Colisiones. class VTK_ESQUI_COLISION_EXPORT vtkLibGenerica: public vtkObject { //***** Metodos Publicos public: vtkTypeRevisionMacro(vtkLibGenerica, vtkObject); /// ---------- Constructor / Destructor ----------- vtkLibGenerica(); ~vtkLibGenerica(); void SetRenderer(vtkRenderer *ren) {this->Renderer = ren;} /// =========================================== /// Metodos virtuales puros /// =========================================== virtual bool inicializar() = 0; //BTX virtual unsigned obtenerIdColisiones(unsigned idOrgano, unsigned idH, unsigned idCaja, unsigned tipoEnvolvente) = 0; virtual unsigned posIdColisiones(unsigned idOrgano, unsigned idH, unsigned idCaja) =0; virtual void crearArbolesColisionOrgano(unsigned idOrgano) = 0; virtual void crearArbolesColisionHerramienta(unsigned idH, unsigned idCaja, unsigned tipoEnvolvente) = 0; //ETX virtual int anadirDeformable(vtkModeloDeformable* pDeformable) = 0; virtual int anadirHerramienta(vtkModeloHerramienta* pHerramienta) = 0; virtual int anadirEstatico(vtkModeloEstatico* pEstatico) = 0; virtual bool eliminarDeformable(int pos) = 0; virtual bool eliminarHerramienta(int pos) = 0; virtual bool eliminarEstatico(int pos) = 0; virtual bool insertarDeformable(int pos,vtkModeloDeformable* pDeformable) = 0; virtual bool insertarHerramienta(int pos,vtkModeloHerramienta* pHerramienta, bool bNueva) = 0; virtual bool insertarEstatico(int pos,vtkModeloEstatico* pEstatico) = 0; //BTX virtual bool detectarColisionOrganoHerramienta( unsigned idCol, unsigned id1, unsigned id2, unsigned id3, vtkInfoColisionCollection* vertices, std::vector& lista, vtkOBB caja) = 0; virtual bool detectaColisionBolaHerramienta(unsigned int herramActual, vtkEsfera *bola)=0; virtual double* obtenerMatriz(unsigned id) = 0; virtual unsigned idDeformable(unsigned id) = 0; virtual unsigned idHerramienta(unsigned id) = 0; virtual unsigned idEstatico(unsigned id) = 0; virtual void obtenerPosAnteriorCaja(unsigned id, unsigned caja, float* posicion) = 0; virtual void obtenerPosCaja(unsigned id, float* posicion) = 0; virtual void obtenerVertices(unsigned id, unsigned cara, unsigned* vertices) = 0; virtual void coordenadasVertices(unsigned id, unsigned vertice, float* coord) = 0; //ETX virtual void calcularNormal(float *verticeA, float *verticeB, float *verticeC, float *normal) = 0; vtkRenderer *Renderer; private: vtkLibGenerica(const vtkLibGenerica &); //NotImplemented void operator =(const vtkLibGenerica &); //Not Implemented }; #endif // ifndef _LIBGENERICA_v10_ //#endif //ifndef __vtkLibGenerica_h