34 #ifndef AIMS_MESH_SURFACEMANIP_H
35 #define AIMS_MESH_SURFACEMANIP_H
46 class AffineTransformation3d;
50 template<
typename T>
class Texture;
54 template <
typename T>
class Volume;
64 template<
int D,
class T>
static std::vector<std::set<uint> >
67 template<
int D,
class T>
static std::vector<std::set<uint> >
70 template<
int D,
class T>
static std::vector<std::set<uint> >
73 template<
int D,
class T>
static std::vector<std::map<uint, float> >
76 template<
int D,
class T>
83 cutMesh(
const std::vector<const AimsSurfaceTriangle *> & insurf,
90 bool checkplane =
true );
92 cutMesh(
const std::vector<const AimsSurfaceTriangle *> & insurf,
96 bool checkplane =
true );
101 bool checkplane =
true );
103 cutMesh(
const std::vector<const AimsSurfaceTriangle *> & insurf,
108 bool checkplane =
true );
113 bool meshplane,
bool checkplane );
115 cutMesh(
const std::vector<const AimsSurfaceTriangle *> & insurf,
120 bool meshplane,
bool checkplane );
149 template<
int D,
class T>
153 template<
int D,
class T>
157 template<
int D,
typename T>
162 template <
int D,
typename T>
166 std::vector<size_t> ** overtIndex = 0 );
171 template <
typename T>
179 template <
typename T>
190 unsigned nneighbours = 1,
191 unsigned* index = 0 );
200 const std::vector<uint> & selectedPolygons = std::vector<uint>() );
205 template <
int D,
typename T>
207 bool asDistance =
false );
211 template <
int D,
typename T>
228 template <
int D,
typename T>
234 template <
int D,
typename T>
249 template <
typename T>
252 T & volume,
int value );
255 template <
int D,
typename T>
256 static std::pair<carto::rc_ptr<AimsTimeSurface<D, Void> >,
261 template <
int D,
typename T>
The template class to manage a mesh.
The template class to manage a mesh with time if needed.
static void sortPolygonsAlongDirection(AimsTimeSurface< D, T > &mesh, int timestep, const Point3df &direction)
Sort polygons along a given direction.
static AimsTimeSurface< D, T > * meshExtract(const AimsTimeSurface< D, T > &mesh, const TimeTexture< int16_t > &tex, int16_t value, std::vector< size_t > **overtIndex=0)
Extracts a sub-mesh region from a label texture.
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 invertSurfacePolygons(AimsTimeSurface< D, T > &surface)
static void cutMesh(const AimsSurface< 3, Void > &insurf, const Point4df &plane, AimsTimeSurface< 2, Void > &borderline)
This variant only computes the border line.
static std::vector< Point3df > * lineDirections(const AimsTimeSurface< 2, Void > &)
calculate directions of a line mesh, fora each vertex
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.
static bool checkMesh(const AimsSurfaceTriangle &insurf, AimsSurfaceTriangle *outsurf=0)
Check mesh for intersecting triangles.
static std::vector< std::map< uint, float > > surfaceNeighbourDistance(const AimsTimeSurface< D, T > &surf)
static void meshPlanarPolygon(const Point4df &plane, const AimsTimeSurface< 2, Void > &border, AimsSurfaceTriangle &outmesh)
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 AimsSurfaceTriangle &insurf, const Point4df &plane, AimsSurfaceTriangle &cut, AimsSurfaceTriangle &planemesh, bool checkplane=true)
static void meshTransform(AimsTimeSurface< D, T > &mesh, const Motion &trans)
Applies a transformation to a mesh.
static std::map< int, float > meshArea(const AimsSurfaceTriangle &surf, const TimeTexture< int16_t > &tex)
static std::map< int, float > meshArea(const AimsSurfaceTriangle &surf, const Texture< int16_t > &tex)
static void cutMesh(const AimsSurfaceTriangle &insurf, const Point4df &plane, AimsTimeSurface< 2, Void > &borderline, int timestep=0)
This variant only computes the border line.
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 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 float meshVolume(const AimsSurface< 3, Void > &surf)
static AimsSurfaceTriangle * refineMeshTri4(const AimsSurfaceTriangle &mesh, const std::vector< uint > &selectedPolygons=std::vector< uint >())
Refine a mesh by subdivising every triangle into 4 smaller ones.
static void meshMerge(AimsTimeSurface< D, T > &dst, const AimsTimeSurface< D, T > &add)
concatenates 2 meshes into one (adds the second to the first one)
static void cutMesh(const AimsSurfaceTriangle &insurf, const Point4df &plane, AimsSurfaceTriangle &cut, AimsSurfaceTriangle &planemesh, AimsTimeSurface< 2, Void > &borderline, bool checkplane=true)
static std::pair< carto::rc_ptr< AimsTimeSurface< D, Void > >, carto::rc_ptr< TimeTexture< T > > > splitTexturedMesh(const AimsTimeSurface< D, T > &texmesh)
Split a textured mesh into a mesh and a texture.
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 bool checkMeshIntersect(const AimsSurfaceTriangle &, const AimsSurfaceTriangle &)
Checks if two meshes intersect.
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 nn...
static carto::rc_ptr< AimsTimeSurface< D, T > > joinTexturedMesh(const AimsTimeSurface< D, Void > &mesh, const TimeTexture< T > &texture)
Join a mesh and a texture into a textured mesh.
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,...
static std::vector< std::set< uint > > surfaceNeighbours(const AimsSurface< D, T > &surf)
static void rasterizeLine(const Point3df &p0, const Point3df &direction, float lmax, T &volume, int value)
T should be carto::Volume<int16_t> or BucketMap<Void>::Bucket.
static void rasterizeMesh(const AimsTimeSurface< 3, Void > &mesh, carto::rc_ptr< carto::Volume< int16_t > > &volume, int value=2)
Rasterize polygons into a volume.
static std::map< int, float > meshArea(const AimsSurface< 3, Void > &surf, const Texture< int16_t > *tex)
static float meshArea(const AimsSurfaceTriangle &surf)
static float meshVolume(const AimsSurfaceTriangle &surf)
static void cutMesh(const AimsSurfaceTriangle &insurf, const Point4df &plane, AimsSurfaceTriangle &cut, AimsTimeSurface< 2, Void > &borderline)
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.
static std::vector< std::set< uint > > surfaceNeighbours2ndOrder(const AimsTimeSurface< D, T > &surf)
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.
static float meshArea(const AimsSurface< 3, Void > &surf)
The class for EcatSino data write operation.
AIMSDATA_API AimsTimeSurface< 3, Void > AimsSurfaceTriangle
aims::AffineTransformation3d Motion