aimsdata  5.1.2
Neuroimaging data handling
surfacegen.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_SURFACE_SURFACEGEN_H
36 #define AIMS_SURFACE_SURFACEGEN_H
37 
38 #include <aims/mesh/surface.h>
40 
41 namespace aims
42 {
43 
46  {
47  public:
49  (*GenFunction)( const carto::GenericObject & );
51  (*GenFunction_wireframe)( const carto::GenericObject & );
52 
53  struct Generator
54  {
55  virtual ~Generator() {}
56 
57  virtual AimsSurfaceTriangle*
58  generator( const carto::GenericObject & ) const = 0;
59  virtual carto::Object parameters() const = 0;
60  };
61 
63  {
64  virtual ~Generator_wireframe() {}
65 
66  virtual AimsTimeSurface<2,Void>*
67  generator( const carto::GenericObject & ) const = 0;
68  virtual carto::Object parameters() const = 0;
69  };
70 
72  static AimsSurfaceTriangle*
73  generate( const carto::GenericObject & params );
80 
85  static void printDescription( std::ostream & s = std::cout );
86  static void printDescription_wireframe( std::ostream & s = std::cout );
87 
88  static AimsSurfaceTriangle* cube( const carto::GenericObject & params );
89  static AimsSurfaceTriangle* cube( const Point3df & center, float radius,
90  bool smoothnormal = false );
91 
92  static AimsSurfaceTriangle*
93  cylinder( const carto::GenericObject & params );
94  static AimsSurfaceTriangle* cylinder( const Point3df & p1,
95  const Point3df & p2, float radius,
96  float radius2, unsigned nfacets,
97  bool closed, bool smooth = false,
98  bool smoooth_tube = true );
99 
100  static AimsSurfaceTriangle* cone( const carto::GenericObject & params );
102  const Point3df & base, float radius,
103  unsigned nfacets, bool closed,
104  bool smooth = false );
105 
106  static AimsSurfaceTriangle*
107  arrow( const carto::GenericObject & params );
109  const Point3df & base, float radius,
110  float arrowradius, unsigned nfacets,
111  float arrowlengthfract );
112 
124  static AimsSurfaceTriangle*
126  static AimsSurfaceTriangle* icosahedron( const Point3df & center,
127  float radius );
128 
129  static AimsSurfaceTriangle*
130  sphere( const carto::GenericObject & params );
131  static AimsSurfaceTriangle* sphere( const Point3df & p1, float radius,
132  unsigned nfacets,
133  bool uniquevertices = false );
134  static AimsSurfaceTriangle*
135  ellipse( const carto::GenericObject & params );
136  static AimsSurfaceTriangle* ellipse( const Point3df & p1, float radius1,
137  float radius2,
138  unsigned nfacets,
139  bool uniquevertices = false );
140  static AimsSurfaceTriangle*
141  icosphere( const carto::GenericObject & params );
142  static AimsSurfaceTriangle* icosphere( const Point3df & center,
143  float radius, unsigned nfacets );
144 
148  const Point3df & boundingbox_min, const Point3df & boundingbox_max );
149 
150  static AimsSurfaceTriangle*
153  const Point3df & boundingbox_min, const Point3df & boundingbox_max,
154  bool smooth = false );
155 
167  const Point3df & center, float radius, unsigned nseg=20,
168  const Point3df & normal = Point3df( 0, 0, 1 ),
169  const Point3df & startdir = Point3df( 1, 0, 0 ), float startangle = 0,
170  float stopangle = M_PI*2 );
171 
173  grid( const carto::GenericObject & params );
174 
179  const Point3df & boundingbox_min, const Point3df & boundingbox_max,
180  const Point3df & grid_sampling );
181  };
182 
183 }
184 
185 
186 #endif
Factory class for various common shapes of meshes.
Definition: surfacegen.h:46
static AimsSurfaceTriangle * cylinder(const Point3df &p1, const Point3df &p2, float radius, float radius2, unsigned nfacets, bool closed, bool smooth=false, bool smoooth_tube=true)
static AimsSurfaceTriangle * parallelepiped(const Point3df &boundingbox_min, const Point3df &boundingbox_max, bool smooth=false)
static AimsTimeSurface< 2, Void > * parallelepiped_wireframe(const Point3df &boundingbox_min, const Point3df &boundingbox_max)
static void printDescription_wireframe(std::ostream &s=std::cout)
static carto::Object description()
description of known shapes and parameters (vector of dicts)
static AimsSurfaceTriangle * parallelepiped(const carto::GenericObject &params)
static AimsSurfaceTriangle * arrow(const carto::GenericObject &params)
static AimsSurfaceTriangle * arrow(const Point3df &arrow, const Point3df &base, float radius, float arrowradius, unsigned nfacets, float arrowlengthfract)
static AimsSurfaceTriangle * generate(carto::Object params)
generic factory function (calls lower-level functions)
static AimsSurfaceTriangle * icosahedron(const Point3df &center, float radius)
static AimsSurfaceTriangle * cube(const Point3df &center, float radius, bool smoothnormal=false)
static AimsSurfaceTriangle * cylinder(const carto::GenericObject &params)
static AimsSurfaceTriangle * icosphere(const carto::GenericObject &params)
static AimsTimeSurface< 2, Void > * generate_wireframe(const carto::GenericObject &params)
static AimsSurfaceTriangle * ellipse(const Point3df &p1, float radius1, float radius2, unsigned nfacets, bool uniquevertices=false)
static AimsTimeSurface< 2, Void > * circle_wireframe(const carto::GenericObject &params)
static AimsSurfaceTriangle * cone(const carto::GenericObject &params)
static void printDescription(std::ostream &s=std::cout)
outputs the description() dictionary in a more huma-readable way
static AimsTimeSurface< 2, Void > * grid(const carto::GenericObject &params)
static AimsSurfaceTriangle * icosphere(const Point3df &center, float radius, unsigned nfacets)
static AimsSurfaceTriangle * cone(const Point3df &arrow, const Point3df &base, float radius, unsigned nfacets, bool closed, bool smooth=false)
static AimsSurfaceTriangle * ellipse(const carto::GenericObject &params)
static AimsSurfaceTriangle * generate(const carto::GenericObject &params)
generic factory function (calls lower-level functions)
static AimsSurfaceTriangle * cube(const carto::GenericObject &params)
static AimsSurfaceTriangle * sphere(const carto::GenericObject &params)
static AimsSurfaceTriangle * icosahedron(const carto::GenericObject &params)
Sphere generation functions by Manik Bhattacharjee (CNRS UPR640 - LENA)
static AimsSurfaceTriangle * sphere(const Point3df &p1, float radius, unsigned nfacets, bool uniquevertices=false)
static AimsTimeSurface< 2, Void > * generate_wireframe(carto::Object params)
generic factory function (calls lower-level functions)
static AimsTimeSurface< 2, Void > * parallelepiped_wireframe(const carto::GenericObject &params)
static carto::Object description_wireframe()
static AimsTimeSurface< 2, Void > * circle_wireframe(const Point3df &center, float radius, unsigned nseg=20, const Point3df &normal=Point3df(0, 0, 1), const Point3df &startdir=Point3df(1, 0, 0), float startangle=0, float stopangle=M_PI *2)
Circle, or part of circle.
static AimsTimeSurface< 2, Void > * grid(const Point3df &boundingbox_min, const Point3df &boundingbox_max, const Point3df &grid_sampling)
Grid wireframe.
The class for EcatSino data write operation.
Definition: borderfiller.h:13
virtual AimsTimeSurface< 2, Void > * generator(const carto::GenericObject &) const =0
virtual carto::Object parameters() const =0
virtual carto::Object parameters() const =0
virtual AimsSurfaceTriangle * generator(const carto::GenericObject &) const =0
AIMSDATA_API AimsTimeSurface< 3, Void > AimsSurfaceTriangle
Definition: surface.h:581