Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

SIG_Mirtich.h

00001 #ifndef SIGEL_ROBOT_SIG_MIRTICH_H
00002 #define SIGEL_ROBOT_SIG_MIRTICH_H
00003 
00004 namespace SIGEL_Robot { class SIG_Mirtich; }
00005 
00006 #include <math.h>
00007 #include <pointvector.h>
00008 #include "SIGEL_Robot/SIG_Geometry.h"
00009 #include "SIGEL_Robot/SIG_GeometryIterator.h"
00010 #include "SIGEL_Robot/SIG_Polygon.h"
00011 
00012 #include "SIGEL_Robot/SIG_RobotExceptions.h"
00013 #include <qstring.h>
00014 
00015 namespace SIGEL_Robot {
00016 
00017         class SIG_Mirtich {
00018                 struct POLYHEDRON;
00019                 typedef double tridouble [3];
00020                 struct FACE {
00021                         int numVerts;
00022                         double norm[3];
00023                         double w;
00024                         int *verts;
00025                         POLYHEDRON *poly;
00026                 };
00027                 struct POLYHEDRON {
00028                         int numVerts, numFaces;
00029                         tridouble *verts;
00030                         FACE *faces;
00031                 };
00032         protected:
00033                 // this is to what we refer
00034                 SIG_Geometry *geom;
00035                 // alpha, beta, gamma
00036                 int A, B, C;
00037                 // projection integrals (return values)
00038                 double P1, Pa, Pb, Paa, Pab, Pbb, Paaa, Paab, Pabb, Pbbb;
00039                 // face integrals (dito)
00040                 double Fa, Fb, Fc, Faa, Fbb, Fcc, Faaa, Fbbb, Fccc, Faab, Fbbc, Fcca;
00041                 // volume integrals (dito, i guess)
00042                 double T0, T1[3], T2[3], TP[3];
00043                 // just a flag
00044                 bool computed;
00045                 QString myExcName;
00046 
00047                 void compProjectionIntegrals (FACE *f);
00048                 void compFaceIntegrals (FACE *f);
00049                 void compVolumeIntegrals (POLYHEDRON *p);
00050                 void compFaceNormal (FACE *f);
00051                 void compute (void);
00052 
00053         public:
00054                 SIG_Mirtich (SIG_Geometry *geom, QString nameOfGeom);
00055                 virtual ~SIG_Mirtich (void);
00056 
00057                 void computePhysics (double density,
00058                                      DL_Scalar & masse,
00059                                      DL_vector & centreOfMass,
00060                                      DL_matrix & inertiaTensor);
00061                 void computeMajorAxes (DL_vector & centreOfMass,
00062                                        DL_vector & v1, DL_vector & v2, DL_vector & v3);
00063                 void moveToOriginAndMajorAxes (DL_vector & translation,
00064                                                DL_matrix & rotation);
00065                 void computeAgain (void) { computed = false; }
00066         };
00067 
00068 }
00069 
00070 #endif

Generated at Mon Sep 3 01:32:28 2001 for PG 368 - SIGEL by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000