NanoShaper  0.7.2
NanoShaper is a tool able to triangulate and inspect an arbitray triangulated surface or several types of molecular surfaces
ExampleSurface Class Reference

This class is a simple example that shows the main concepts needed to introduce a new surface in NanoShaper. This class builds a sphere centered on the baricenter of input points whose radius is specified by the user. This surface is ray-casting based and it is a trivial Surface definition. On a real scenario high performance is needed; to get performance the Developer can use the same strategies used in other surfaces such as in classes ConnollySurface and SkinSurface. The acceleration strategies are 2D/3D grids that allow fast retrieval of points or in general of simplices and patches. To add a new surface it is sufficient that you define a class withi this style (see registration class) and then it will be automatically loaded; you don't have to change any make file or cmake file, just write the source and put it the src folder. More...

#include <ExampleSurface.h>

Inheritance diagram for ExampleSurface:
Surface

List of all members.

Public Member Functions

 ExampleSurface ()
 ExampleSurface (DelPhiShared *ds)
 ExampleSurface (ConfigFile *cf, DelPhiShared *ds)
virtual bool build ()
virtual bool save (char *fileName)
virtual bool load (char *fileName)
virtual void printSummary ()
virtual bool getProjection (double p[3], double *proj1, double *proj2, double *proj3, double *normal1, double *normal2, double *normal3)
virtual void getRayIntersection (double p1[3], double p2[3], vector< pair< double, double * > > &intersections, int thdID, bool computeNormals)
virtual void init ()
virtual void init (ConfigFile *cf)
virtual void clear ()
virtual void preProcessPanel ()
virtual void postRayCasting ()
virtual bool preBoundaryProjection ()
void setRadius (double r)
double getRadius ()

Detailed Description

This class is a simple example that shows the main concepts needed to introduce a new surface in NanoShaper. This class builds a sphere centered on the baricenter of input points whose radius is specified by the user. This surface is ray-casting based and it is a trivial Surface definition. On a real scenario high performance is needed; to get performance the Developer can use the same strategies used in other surfaces such as in classes ConnollySurface and SkinSurface. The acceleration strategies are 2D/3D grids that allow fast retrieval of points or in general of simplices and patches. To add a new surface it is sufficient that you define a class withi this style (see registration class) and then it will be automatically loaded; you don't have to change any make file or cmake file, just write the source and put it the src folder.

Author:
Sergio Decherchi
Date:
29/10/2013

Constructor & Destructor Documentation

ExampleSurface::ExampleSurface ( )

Default constructor

ExampleSurface::ExampleSurface ( DelPhiShared ds)

set DelPhi environment

ExampleSurface::ExampleSurface ( ConfigFile *  cf,
DelPhiShared ds 
)

set configuration and DelPhi environment


Member Function Documentation

bool ExampleSurface::build ( ) [virtual]

Compute the surface. Call it after load

Implements Surface.

void ExampleSurface::clear ( ) [virtual]

function for the denstructor

Implements Surface.

bool ExampleSurface::getProjection ( double  p[3],
double *  proj1,
double *  proj2,
double *  proj3,
double *  normal1,
double *  normal2,
double *  normal3 
) [virtual]

Get a projection of a point on the surface. Return projection and normal

Implements Surface.

void ExampleSurface::getRayIntersection ( double  p1[3],
double  p2[3],
vector< pair< double, double * > > &  intersections,
int  thdID,
bool  computeNormals 
) [inline, virtual]

Get all the intersections of a ray that goes from P1 to P2 over the surface. The interesctions are returned with increasing distance order. the first double in the vector is the t parameter for the intersection of the parametric line and the surface, the double pointer is the normal vector.

Implements Surface.

void ExampleSurface::init ( ) [virtual]

function for the constructor without arguments

Implements Surface.

void ExampleSurface::init ( ConfigFile *  cf) [virtual]

functions for the constructor with config file argument

Implements Surface.

bool ExampleSurface::load ( char *  fileName) [virtual]

Load the surface from a file in .example format. It is not implemented

Implements Surface.

void ExampleSurface::postRayCasting ( ) [virtual]

here you should put your code clean memory after ray casting

Reimplemented from Surface.

bool ExampleSurface::preBoundaryProjection ( ) [virtual]

here you should put your code to prepare a 2D/3D acceleration structure for point to surface projection

Reimplemented from Surface.

void ExampleSurface::preProcessPanel ( ) [virtual]

here you should put your code to prepare a 2D/3D acceleration structure for ray tracing

Reimplemented from Surface.

void ExampleSurface::printSummary ( ) [virtual]

Print a summary of the surface

Implements Surface.

bool ExampleSurface::save ( char *  fileName) [virtual]

Save it in a simple ASCII format (.example). It is not implemented

Implements Surface.


The documentation for this class was generated from the following files: