A.I.M.S


aims::SurfaceManip Class Reference

#include <aims/mesh/surfaceOperation.h>

Static Public Member Functions

template<int D, class T >
static std::vector< std::set
< uint > > 
surfaceNeighbours (const AimsSurface< D, T > &surf)
 
template<int D, class T >
static std::vector< std::set
< uint > > 
surfaceNeighbours (const AimsTimeSurface< D, T > &surf)
 
template<int D, class T >
static std::vector< std::set
< uint > > 
surfaceNeighbours2ndOrder (const AimsTimeSurface< D, T > &surf)
 
template<int D, class T >
static std::vector< std::map
< uint, float > > 
surfaceNeighbourDistance (const AimsTimeSurface< D, T > &surf)
 
template<int D, class T >
static void invertSurfacePolygons (AimsTimeSurface< D, T > &surface)
 
static void cutMesh (const AimsSurfaceTriangle &insurf, const Point4df &plane, AimsSurfaceTriangle &cut, AimsTimeSurface< 2, Void > &borderline)
 
static void cutMesh (const std::vector< const AimsSurfaceTriangle * > &insurf, const Point4df &plane, std::vector< carto::rc_ptr< AimsSurfaceTriangle > > &cut, AimsTimeSurface< 2, Void > &borderline)
 
static void cutMesh (const AimsSurfaceTriangle &insurf, const Point4df &plane, AimsSurfaceTriangle &cut, AimsSurfaceTriangle &planemesh, bool checkplane=true)
 
static void cutMesh (const std::vector< const AimsSurfaceTriangle * > &insurf, const Point4df &plane, std::vector< carto::rc_ptr< AimsSurfaceTriangle > > &cut, AimsSurfaceTriangle &planemesh, bool checkplane=true)
 
static void cutMesh (const AimsSurfaceTriangle &insurf, const Point4df &plane, AimsSurfaceTriangle &cut, AimsSurfaceTriangle &planemesh, AimsTimeSurface< 2, Void > &borderline, bool checkplane=true)
 
static void cutMesh (const std::vector< const AimsSurfaceTriangle * > &insurf, const Point4df &plane, std::vector< carto::rc_ptr< AimsSurfaceTriangle > > &cut, AimsSurfaceTriangle &planemesh, AimsTimeSurface< 2, Void > &borderline, bool checkplane=true)
 
static void cutMesh (const AimsSurfaceTriangle &insurf, const Point4df &plane, AimsSurfaceTriangle &cut, AimsSurfaceTriangle &planemesh, AimsTimeSurface< 2, Void > &borderline, bool meshplane, bool checkplane)
 
static void cutMesh (const std::vector< const AimsSurfaceTriangle * > &insurf, const Point4df &plane, std::vector< carto::rc_ptr< AimsSurfaceTriangle > > &cut, AimsSurfaceTriangle &planemesh, AimsTimeSurface< 2, Void > &borderline, bool meshplane, bool checkplane)
 
static void cutMesh (const AimsSurfaceTriangle &insurf, const Point4df &plane, AimsTimeSurface< 2, Void > &borderline, int timestep=0)
 This variant only computes the border line. More...
 
static void cutMesh (const AimsSurface< 3, Void > &insurf, const Point4df &plane, AimsTimeSurface< 2, Void > &borderline)
 This variant only computes the border line. More...
 
static void meshPlanarPolygon (const Point4df &plane, const AimsTimeSurface< 2, Void > &border, AimsSurfaceTriangle &outmesh)
 
static bool checkMesh (const AimsSurfaceTriangle &insurf, AimsSurfaceTriangle *outsurf=0)
 Check mesh for intersecting triangles. More...
 
static float meshArea (const AimsSurfaceTriangle &surf)
 
static float meshVolume (const AimsSurfaceTriangle &surf)
 
template<int D, class T >
static void meshMerge (AimsTimeSurface< D, T > &dst, const AimsTimeSurface< D, T > &add)
 concatenates 2 meshes into one (adds the second to the first one) More...
 
template<int D, class T >
static void meshMerge (AimsTimeSurface< D, T > &dst, const std::list< AimsTimeSurface< D, T > > &src)
 concatenates several meshes (src) into a single one (dst) More...
 
template<int D, typename T >
static void meshTransform (AimsTimeSurface< D, T > &mesh, const Motion &trans)
 Applies a transformation to a mesh. More...
 
template<int D, typename T >
static AimsTimeSurface< D, T > * meshExtract (const AimsTimeSurface< D, T > &mesh, const TimeTexture< int16_t > &tex, int16_t value, std::vector< size_t > **overtIndex=0)
 
template<typename T >
static AimsSurface< 2, Void > * meshTextureBoundary (const AimsSurface< 3, Void > &mesh, const Texture< T > &tex, T region)
 Extracts the boundary of region of value <region> of the input texture, on the mesh. More...
 
template<typename T >
static AimsTimeSurface< 2, Void > * meshTextureBoundary (const AimsSurfaceTriangle &mesh, const TimeTexture< T > &tex, T region)
 Extracts the boundary of region of value <region> of the input texture, on the mesh. More...
 
static Point3df nearestPointToMesh (const Point3df &pos, const AimsSurfaceTriangle &mesh, unsigned nneighbours=1, unsigned *index=0)
 computes the position of the point in the mesh nearest to the given position, averaging across the nneighbours nearest vertices. More...
 
static AimsSurfaceTrianglerefineMeshTri4 (const AimsSurfaceTriangle &mesh, const std::vector< uint > &selectedPolygons=std::vector< uint >())
 Refine a mesh by subdivising every triangle into 4 smaller ones. More...
 
template<int D, typename T >
static TimeTexture< float > * meshDensity (const AimsTimeSurface< D, T > &mesh, bool asDistance=false)
 Calculate a mesh density: inverse of the average edges distance If asDistance is true, then the average distance is returned instead of the density. More...
 
template<int D, typename T >
static TimeTexture< float > * meshEdgeLengthRatioTexture (const AimsTimeSurface< D, T > &nummesh, const AimsTimeSurface< D, T > &denommesh)
 Calculate an edge length ratio in edges of two meshes with the same topology. More...
 
static bool checkMeshIntersect (const AimsSurfaceTriangle &, const AimsSurfaceTriangle &)
 Checks if two meshes intersect. More...
 
static std::vector< Point3df > * lineDirections (const AimsTimeSurface< 2, Void > &)
 calculate directions of a line mesh, fora each vertex More...
 
template<int D, typename T >
static void sortPolygonsAlongDirection (AimsTimeSurface< D, T > &mesh, int timestep, const Point3df &direction)
 Sort polygons along a given direction. More...
 
template<int D, typename T >
static void rasterizeMeshWireframe (const AimsTimeSurface< D, T > &mesh, carto::rc_ptr< carto::Volume< int16_t > > &volume, int value=1)
 Rasterize polygons edges into a volume. More...
 
static void rasterizeMesh (const AimsTimeSurface< 3, Void > &mesh, carto::rc_ptr< carto::Volume< int16_t > > &volume, int value=2)
 Rasterize polygons into a volume. More...
 

Detailed Description

Definition at line 64 of file surfaceOperation.h.

Member Function Documentation

static bool aims::SurfaceManip::checkMesh ( const AimsSurfaceTriangle insurf,
AimsSurfaceTriangle outsurf = 0 
)
static

Check mesh for intersecting triangles.

If outsurf is not null and intersecting triangles do exist, outsurf is used to store a corrected mesh

static bool aims::SurfaceManip::checkMeshIntersect ( const AimsSurfaceTriangle ,
const AimsSurfaceTriangle  
)
static

Checks if two meshes intersect.

static void aims::SurfaceManip::cutMesh ( const AimsSurfaceTriangle insurf,
const Point4df plane,
AimsSurfaceTriangle cut,
AimsTimeSurface< 2, Void > &  borderline 
)
static
static void aims::SurfaceManip::cutMesh ( const std::vector< const AimsSurfaceTriangle * > &  insurf,
const Point4df plane,
std::vector< carto::rc_ptr< AimsSurfaceTriangle > > &  cut,
AimsTimeSurface< 2, Void > &  borderline 
)
static
static void aims::SurfaceManip::cutMesh ( const AimsSurfaceTriangle insurf,
const Point4df plane,
AimsSurfaceTriangle cut,
AimsSurfaceTriangle planemesh,
bool  checkplane = true 
)
static
static void aims::SurfaceManip::cutMesh ( const std::vector< const AimsSurfaceTriangle * > &  insurf,
const Point4df plane,
std::vector< carto::rc_ptr< AimsSurfaceTriangle > > &  cut,
AimsSurfaceTriangle planemesh,
bool  checkplane = true 
)
static
static void aims::SurfaceManip::cutMesh ( const AimsSurfaceTriangle insurf,
const Point4df plane,
AimsSurfaceTriangle cut,
AimsSurfaceTriangle planemesh,
AimsTimeSurface< 2, Void > &  borderline,
bool  checkplane = true 
)
static
static void aims::SurfaceManip::cutMesh ( const std::vector< const AimsSurfaceTriangle * > &  insurf,
const Point4df plane,
std::vector< carto::rc_ptr< AimsSurfaceTriangle > > &  cut,
AimsSurfaceTriangle planemesh,
AimsTimeSurface< 2, Void > &  borderline,
bool  checkplane = true 
)
static
static void aims::SurfaceManip::cutMesh ( const AimsSurfaceTriangle insurf,
const Point4df plane,
AimsSurfaceTriangle cut,
AimsSurfaceTriangle planemesh,
AimsTimeSurface< 2, Void > &  borderline,
bool  meshplane,
bool  checkplane 
)
static
static void aims::SurfaceManip::cutMesh ( const std::vector< const AimsSurfaceTriangle * > &  insurf,
const Point4df plane,
std::vector< carto::rc_ptr< AimsSurfaceTriangle > > &  cut,
AimsSurfaceTriangle planemesh,
AimsTimeSurface< 2, Void > &  borderline,
bool  meshplane,
bool  checkplane 
)
static
static void aims::SurfaceManip::cutMesh ( const AimsSurfaceTriangle insurf,
const Point4df plane,
AimsTimeSurface< 2, Void > &  borderline,
int  timestep = 0 
)
static

This variant only computes the border line.

static void aims::SurfaceManip::cutMesh ( const AimsSurface< 3, Void > &  insurf,
const Point4df plane,
AimsTimeSurface< 2, Void > &  borderline 
)
static

This variant only computes the border line.

template<int D, class T >
void aims::SurfaceManip::invertSurfacePolygons ( AimsTimeSurface< D, T > &  surface)
static

Definition at line 134 of file surfaceOperation_d.h.

References AimsSurface< D, T >::polygon().

Referenced by meshTransform().

static std::vector<Point3df>* aims::SurfaceManip::lineDirections ( const AimsTimeSurface< 2, Void > &  )
static

calculate directions of a line mesh, fora each vertex

static float aims::SurfaceManip::meshArea ( const AimsSurfaceTriangle surf)
static
template<int D, typename T >
TimeTexture< float > * aims::SurfaceManip::meshDensity ( const AimsTimeSurface< D, T > &  mesh,
bool  asDistance = false 
)
static

Calculate a mesh density: inverse of the average edges distance If asDistance is true, then the average distance is returned instead of the density.

Definition at line 371 of file surfaceOperation_d.h.

References norm(), AimsSurface< D, T >::polygon(), and AimsSurface< D, T >::vertex().

template<int D, typename T >
TimeTexture< float > * aims::SurfaceManip::meshEdgeLengthRatioTexture ( const AimsTimeSurface< D, T > &  nummesh,
const AimsTimeSurface< D, T > &  denommesh 
)
static

Calculate an edge length ratio in edges of two meshes with the same topology.

The max length ratios of edges is kept for each vertex

Definition at line 433 of file surfaceOperation_d.h.

References norm(), AimsSurface< D, T >::polygon(), and AimsSurface< D, T >::vertex().

template<int D, typename T >
AimsTimeSurface< D, T > * aims::SurfaceManip::meshExtract ( const AimsTimeSurface< D, T > &  mesh,
const TimeTexture< int16_t > &  tex,
int16_t  value,
std::vector< size_t > **  overtIndex = 0 
)
static
template<int D, class T >
void aims::SurfaceManip::meshMerge ( AimsTimeSurface< D, T > &  dst,
const AimsTimeSurface< D, T > &  add 
)
static

concatenates 2 meshes into one (adds the second to the first one)

Definition at line 159 of file surfaceOperation_d.h.

References AimsTimeSurface< D, T >::header(), norm(), norm2(), AimsSurface< D, T >::normal(), AimsSurface< D, T >::polygon(), carto::PointerObject< class >::setProperty(), and AimsSurface< D, T >::vertex().

Referenced by meshMerge().

template<int D, class T >
void aims::SurfaceManip::meshMerge ( AimsTimeSurface< D, T > &  dst,
const std::list< AimsTimeSurface< D, T > > &  src 
)
static

concatenates several meshes (src) into a single one (dst)

Definition at line 196 of file surfaceOperation_d.h.

References AimsTimeSurface< D, T >::erase(), and meshMerge().

static void aims::SurfaceManip::meshPlanarPolygon ( const Point4df plane,
const AimsTimeSurface< 2, Void > &  border,
AimsSurfaceTriangle outmesh 
)
static
template<typename T >
AimsSurface< 2, Void > * aims::SurfaceManip::meshTextureBoundary ( const AimsSurface< 3, Void > &  mesh,
const Texture< T > &  tex,
region 
)
static

Extracts the boundary of region of value <region> of the input texture, on the mesh.

If region is negative, take boundaries of all regions. The input texture is a label texture.

Definition at line 529 of file surfaceOperation_d.h.

References AimsSurface< D, T >::polygon(), aims::internal::take_mid_point_and_insert(), and AimsSurface< D, T >::vertex().

Referenced by meshTextureBoundary().

template<typename T >
AimsTimeSurface< 2, Void > * aims::SurfaceManip::meshTextureBoundary ( const AimsSurfaceTriangle mesh,
const TimeTexture< T > &  tex,
region 
)
static

Extracts the boundary of region of value <region> of the input texture, on the mesh.

If region is negative, take boundaries of all regions. The input texture is a label texture.

Definition at line 635 of file surfaceOperation_d.h.

References meshTextureBoundary().

template<int D, class T >
void aims::SurfaceManip::meshTransform ( AimsTimeSurface< D, T > &  mesh,
const Motion trans 
)
static
static float aims::SurfaceManip::meshVolume ( const AimsSurfaceTriangle surf)
static
static Point3df aims::SurfaceManip::nearestPointToMesh ( const Point3df pos,
const AimsSurfaceTriangle mesh,
unsigned  nneighbours = 1,
unsigned *  index = 0 
)
static

computes the position of the point in the mesh nearest to the given position, averaging across the nneighbours nearest vertices.

The optional index parameter will contain, when given, the index of the nearest mesh vertex

static void aims::SurfaceManip::rasterizeMesh ( const AimsTimeSurface< 3, Void > &  mesh,
carto::rc_ptr< carto::Volume< int16_t > > &  volume,
int  value = 2 
)
static

Rasterize polygons into a volume.

template<int D, typename T >
void aims::SurfaceManip::rasterizeMeshWireframe ( const AimsTimeSurface< D, T > &  mesh,
carto::rc_ptr< carto::Volume< int16_t > > &  volume,
int  value = 1 
)
static
static AimsSurfaceTriangle* aims::SurfaceManip::refineMeshTri4 ( const AimsSurfaceTriangle mesh,
const std::vector< uint > &  selectedPolygons = std::vector< uint >() 
)
static

Refine a mesh by subdivising every triangle into 4 smaller ones.

If selectedPolygons is specified (non-empty), it should contain polygons indices which must specifically be refined, the remaining ones will stay unchanged.

template<int D, typename T >
void aims::SurfaceManip::sortPolygonsAlongDirection ( AimsTimeSurface< D, T > &  mesh,
int  timestep,
const Point3df direction 
)
static

Sort polygons along a given direction.

Polygons centers will be used for sorting. Only one timestep is performed (to be fast).

Definition at line 683 of file surfaceOperation_d.h.

References AimsVector< T, D >::dot(), AimsTimeSurface< D, T >::polygon(), and AimsTimeSurface< D, T >::vertex().

template<int D, class T >
std::vector< std::map< uint, float > > aims::SurfaceManip::surfaceNeighbourDistance ( const AimsTimeSurface< D, T > &  surf)
static
template<int D, class T >
std::vector< std::set< uint > > aims::SurfaceManip::surfaceNeighbours ( const AimsSurface< D, T > &  surf)
static
template<int D, class T >
std::vector< std::set< uint > > aims::SurfaceManip::surfaceNeighbours ( const AimsTimeSurface< D, T > &  surf)
static
template<int D, class T >
std::vector< std::set< uint > > aims::SurfaceManip::surfaceNeighbours2ndOrder ( const AimsTimeSurface< D, T > &  surf)
static

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