NanoShaper  0.7.2
NanoShaper is a tool able to triangulate and inspect an arbitray triangulated surface or several types of molecular surfaces
C:/Documents and Settings/sdecherchi/My Documents/Ricerca/software nostro/NanoShaper0.7/src/ExampleSurface.h
Go to the documentation of this file.
00001 //---------------------------------------------------------
00005 //---------------------------------------------------------
00006 
00007 #ifndef ExampleSurface_h
00008 #define ExampleSurface_h
00009 
00010 #include "Surface.h"
00011 
00012 // 1 Angstrom default radius
00013 #define DEFAULT_RADIUS 1.0
00014 
00030 class ExampleSurface: public Surface
00031 {
00032 
00033 private:
00034 
00035         double radius;
00036         double center[3];
00037 
00038 public:
00040         ExampleSurface();
00042         ExampleSurface(DelPhiShared* ds);                       
00044         ExampleSurface(ConfigFile* cf,DelPhiShared* ds);                        
00045 
00047 
00048         virtual bool build();
00050         virtual bool save(char* fileName);
00052         virtual bool load(char* fileName);
00054         virtual void printSummary();            
00056         virtual bool getProjection(double p[3],double* proj1,double* proj2,
00057                 double* proj3,double* normal1,double* normal2,double* normal3);
00062         virtual void getRayIntersection(double p1[3],double p2[3],vector<pair<double,double*> >& intersections,int thdID,bool computeNormals);
00064         virtual void init();
00066         virtual void init(ConfigFile* cf);
00068         virtual void clear();
00070         virtual void preProcessPanel();
00072         virtual void postRayCasting();
00074         virtual bool preBoundaryProjection();
00076 
00077         void setRadius(double r) 
00078         { 
00079                 if (r<=0)
00080                 {
00081                         cout << endl << WARN << "Cannot set a radius <0. Setting the default value";
00082                         radius = DEFAULT_RADIUS;
00083                 }
00084                 else
00085                         radius = r;
00086         }
00087         
00088         double getRadius() 
00089         {
00090                 return radius;
00091         }
00092         
00093         virtual ~ExampleSurface();
00094 
00095 };
00096 
00097 
00104 /*
00105 static class ExampleSurfaceRegister{ 
00106         static Surface* createSurface(ConfigFile* conf,DelPhiShared* ds) 
00107         { 
00108                 return new ExampleSurface(conf,ds); 
00109         } 
00110         public: 
00111                 ExampleSurfaceRegister() 
00112                 { 
00113                         surfaceFactory().add("example",createSurface); 
00114                 } 
00115 } ExampleSurfaceRegisterObject;
00116 */
00117 
00118 static SurfaceRecorder<ExampleSurface> exampleRecorder("example");
00119 
00120 #endif