A.I.M.S algorithms


meshinterpoler.h
Go to the documentation of this file.
1 /* This software and supporting documentation are distributed by
2  * Institut Federatif de Recherche 49
3  * CEA/NeuroSpin, Batiment 145,
4  * 91191 Gif-sur-Yvette cedex
5  * France
6  *
7  * This software is governed by the CeCILL-B license under
8  * French law and abiding by the rules of distribution of free software.
9  * You can use, modify and/or redistribute the software under the
10  * terms of the CeCILL-B license as circulated by CEA, CNRS
11  * and INRIA at the following URL "http://www.cecill.info".
12  *
13  * As a counterpart to the access to the source code and rights to copy,
14  * modify and redistribute granted by the license, users are provided only
15  * with a limited warranty and the software's author, the holder of the
16  * economic rights, and the successive licensors have only limited
17  * liability.
18  *
19  * In this respect, the user's attention is drawn to the risks associated
20  * with loading, using, modifying and/or developing or reproducing the
21  * software by the user in light of its specific status of free software,
22  * that may mean that it is complicated to manipulate, and that also
23  * therefore means that it is reserved for developers and experienced
24  * professionals having in-depth computer knowledge. Users are therefore
25  * encouraged to load and test the software's suitability as regards their
26  * requirements in conditions enabling the security of their systems and/or
27  * data to be ensured and, more generally, to use and operate it in the
28  * same conditions as regards security.
29  *
30  * The fact that you are presently reading this means that you have had
31  * knowledge of the CeCILL-B license and that you accept its terms.
32  */
33 
34 
35 #ifndef AIMS_MESH_MESHINTERPOLER_H
36 #define AIMS_MESH_MESHINTERPOLER_H
37 
38 #include <aims/mesh/surface.h>
39 #include <aims/mesh/texture.h>
40 
41 
42 namespace aims
43 {
44 
62  {
63  public:
65  {
68  };
69 
70  MeshInterpoler( const AimsSurfaceTriangle & source, const
71  AimsSurfaceTriangle & dest );
74  MeshInterpoler( const Point3df* sourceVert,
75  const AimsVector<uint,3>* sourcePoly,
76  uint nSourcePolygon, const Point3df* destVertex,
77  const AimsVector<uint,3>* destPolygon, uint nDestVertex,
78  uint nDestPolygon );
79  virtual ~MeshInterpoler();
80 
89  void setDiscontinuityThresholds( float xthresh, float ythresh,
90  float zthresh );
96  void project();
103  ) const;
104  template <typename T> TimeTexture<T> *
106  InterpolationType = Linear ) const;
107  template <typename T> void
108  resampleTexture( const Texture<T> & source, Texture<T> & dest,
109  int timestep = 0, InterpolationType = Linear ) const;
111  template <typename T> void
112  resampleTexture( const T *source, T *dest, int timestep = 0,
113  InterpolationType = Linear ) const;
114 
115  const TimeTexture<uint> & projectedTriangles() const;
116  const TimeTexture<float> & projectedTriCoord1() const;
117  const TimeTexture<float> & projectedTriCoord2() const;
118  const TimeTexture<float> & projectedTriCoord3() const;
120  void reloadProjectionParams( const TimeTexture<uint> & projTriangles,
121  const TimeTexture<float> & projTriCoord1,
122  const TimeTexture<float> & projTriCoord2,
123  const TimeTexture<float> & projTriCoord3 );
124  void setMeshes( const AimsSurfaceTriangle & source, const
125  AimsSurfaceTriangle & dest );
126 
127  protected:
128  MeshInterpoler();
130  void findNeighbours();
132  void processCoordinates();
133  void findNeighbours_timestep( const Point3df *sourceVert,
134  const AimsVector<uint,3>* sourcePoly, uint nSourcePolygon,
135  const Point3df* destVertex, uint nDestVertex, int timestep );
136  void processCoordinates_timestep( const Point3df *sourceVert,
137  const AimsVector<uint,3> *sourcePoly, const Point3df *destVertex,
138  uint nDestVertex, int timestep );
139  private:
140  struct Private;
141  Private *d;
142  };
143 
144 
146  {
147  public:
149  const AimsSurfaceTriangle & dest,
150  const TimeTexture<float> & srccoord1,
151  const TimeTexture<float> & srccoord2,
152  const TimeTexture<float> & dstcoord1,
153  const TimeTexture<float> & dstcoord2 );
155 
156  private:
157  struct Private;
158  Private *d2;
159  };
160 
161 }
162 
163 #endif
164 
const TimeTexture< float > & projectedTriCoord1() const
AIMSDATA_API AimsTimeSurface< 3, Void > AimsSurfaceTriangle
void processCoordinates_timestep(const Point3df *sourceVert, const AimsVector< uint, 3 > *sourcePoly, const Point3df *destVertex, uint nDestVertex, int timestep)
void reloadProjectionParams(const TimeTexture< uint > &projTriangles, const TimeTexture< float > &projTriCoord1, const TimeTexture< float > &projTriCoord2, const TimeTexture< float > &projTriCoord3)
set interpoler internal state (for instance to reload it after saving)
void processCoordinates()
sub-step 2 of project(): calculates projectedTriCoord*
Triangular mesh and texture interpolation.
TimeTexture< T > * resampleTexture(const TimeTexture< T > &, InterpolationType=Linear) const
void findNeighbours()
sub-step 1 of project(): calculates projectedTriangles
const TimeTexture< float > & projectedTriCoord2() const
AimsSurfaceTriangle * resampleMesh(const AimsSurfaceTriangle &sourceshape) const
Resample the sourceshape mesh onto the topology of the interpoler destination mesh, but staying in the native space of sourceshape.
virtual ~MeshInterpoler()
void findNeighbours_timestep(const Point3df *sourceVert, const AimsVector< uint, 3 > *sourcePoly, uint nSourcePolygon, const Point3df *destVertex, uint nDestVertex, int timestep)
void setMeshes(const AimsSurfaceTriangle &source, const AimsSurfaceTriangle &dest)
void setDiscontinuityThresholds(float xthresh, float ythresh, float zthresh)
Discontinuities may occur in some meshes, on their vertices coordinates (especially when built from c...
unsigned int uint
const TimeTexture< uint > & projectedTriangles() const
void project()
Main projection function.
CoordinatesFieldMeshInterpoler(const AimsSurfaceTriangle &source, const AimsSurfaceTriangle &dest, const TimeTexture< float > &srccoord1, const TimeTexture< float > &srccoord2, const TimeTexture< float > &dstcoord1, const TimeTexture< float > &dstcoord2)
const TimeTexture< float > & projectedTriCoord3() const