Biomechanical Joint Model
 Author: Anderson Maciel

comevertex3d.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2000 by Anderson Maciel                                 *
00003  *   andi.maciel@gmail.com                                                 *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  **************************************************************************/
00020 
00022 //  FILE........: vpvector3d.h
00023 //  DESCRIPTION.: Contain the COME_Vector3D class declarations.
00024 //
00025 //  AUTHOR......: Anderson Maciel
00026 //  DATE........: August/22/2000
00027 //  DESCRIPTION.: Classe and methods declaration.
00028 //
00030 
00031 #ifndef __COME_VERTEX3D_H
00032 #define __COME_VERTEX3D_H
00033 
00034 #include <algebra/comepoint3d.h>
00035 #include <algebra/comevector3d.h>
00036 
00037 enum {CL_RED, CL_GREEN, CL_BLUE, CL_APLHA};
00038 
00039 //#ifndef __COME_MOLECULE_H
00040 class COME_Molecule;
00041 class COME_Mesh;
00042 //#endif
00043 
00045 // Class Name: COME_Vertex3D
00046 // Superclass: COME_Point3D
00047 // Subclass: -
00048 
00049 class COME_Vertex3D: public COME_Point3D {
00050 
00051         private:
00052                 double                  color[4]; //Use CL_RED, CL_GREEN, CL_BLUE and CL_ALPHA as indices
00053                 COME_Point2D            texCoord;
00054                 COME_Vector3D   normal;
00055                 COME_Vector3D   collisionDisp;
00056                 COME_Vector3D   velocityDisp;
00057                 //int                           collisionCount;
00058                 //int                           velocityCount;
00059                 bool                            collide;
00060                 COME_Vector3D   normalGlobalPosition;
00061                 int                             ownerFace;
00062                 vector<int>                     neighbourFaces;
00063                 vector<COME_Vertex3D *> neighborVerts;
00064         public:
00065                 
00066                 COME_Vertex3D ( void );
00067                 COME_Vertex3D( double x, double y, double z);
00068                 COME_Vertex3D( COME_Vertex3D *v);
00069                 COME_Vertex3D( const COME_Vertex3D &v);
00070                 COME_Vertex3D( double x, double y, double z, short int color[4]);
00071                 COME_Vertex3D( double x, double y, double z, COME_Vector3D n);
00072                 COME_Vertex3D( double x, double y, double z, short int c[4], COME_Vector3D n);
00073                 COME_Vertex3D& operator=(COME_Vertex3D&);
00074                 COME_Vertex3D& operator=(const COME_Vector3D&);
00075                 COME_Vertex3D& operator+=(const COME_Vector3D&);
00076                 
00077                 COME_Vector3D           getNormal( void );
00078                 COME_Vector3D           getCollisionDisp( void );
00079                 COME_Vector3D           getCollisionDispAvg( void );
00080                 COME_Vector3D           getVelocityDisp( void );
00081                 COME_Vector3D           getVelocityDispAvg( void );
00082                 COME_Vector3D           getBlendedVelocity( void );
00083                 int                     getOwnerFace( void );
00084                 COME_Point3D            getBlendedPosition( void );
00085                 COME_Point2D            getTexCoord( void );
00086                 vector<COME_Molecule*>& getAnchors( void );
00087                 vector<COME_Molecule*>* getAnchorsPt( void );
00088                 vector<COME_Point3D>&   getLocalPositions( void );
00089                 double                  getStress( void );
00090                 double                  getStrain( void );
00091                 COME_Vector3D   getColorMaterial( void );
00092                 COME_Point3D            getVertexAsPoint3D();
00093 
00094                 void    setColor(double* c);
00095                 double* getColor();
00096                 void    setNormal (COME_Vector3D n);
00097                 void    setCollisionDisp (COME_Vector3D c);
00098                 void    addCollisionDisp (COME_Vector3D c);
00099                 void    setVelocityDisp (COME_Vector3D c);
00100                 void    addVelocityDisp (COME_Vector3D c);
00101                 void    setOwnerFace( int index );
00102                 void    addAnchor( COME_Molecule* newAnchor );
00103                 void    addLocalPosition( COME_Point3D newPosition );
00104                 void    setTexCoord( COME_Point2D newUV );
00105                 bool    anchorsCollide();
00106                 bool    hasFixedAnchor( void );
00107                 void    setCollide( bool yesno );
00108                 bool    getCollide();
00109 
00110 
00111                 vector<COME_Molecule*>  anchors;
00112                 vector<COME_Point3D>    localPositions;
00113                 
00114                 //Added by Jean
00115                 void            setNormalGlobalPosition( COME_Vector3D n );
00116                 COME_Vector3D*  getNormalGlobalPositionPt( void );
00117                 COME_Vector3D   getNormalGlobalPosition( void );
00118                 
00119                 void            addNeighbour(int faceIndex, COME_Mesh *theMesh );
00120                 vector<int>     getNeighbourFaces();
00121                 vector<COME_Vertex3D *> getNeighborVerts();
00122                 COME_Vertex3D * getNeighborClosestTo( COME_Vertex3D *vPos );
00123 
00124                 //test
00125                 COME_Point3D pPlane;
00126 
00127 };
00128 
00129 #endif

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