aimsdata  4.7.0
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:
48  typedef AimsSurfaceTriangle*
49  (*GenFunction)( const carto::GenericObject & );
50  typedef AimsTimeSurface<2,Void>*
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 );
75  static AimsSurfaceTriangle* generate( carto::Object params );
77  generate_wireframe( const carto::GenericObject & params );
80 
82  static carto::Object description();
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 
99  static AimsSurfaceTriangle* cone( const carto::GenericObject & params );
100  static AimsSurfaceTriangle* cone( const Point3df & arrow,
101  const Point3df & base, float radius,
102  unsigned nfacets, bool closed,
103  bool smooth = false );
104 
105  static AimsSurfaceTriangle*
106  arrow( const carto::GenericObject & params );
107  static AimsSurfaceTriangle* arrow( const Point3df & arrow,
108  const Point3df & base, float radius,
109  float arrowradius, unsigned nfacets,
110  float arrowlengthfract );
111 
123  static AimsSurfaceTriangle*
124  icosahedron( const carto::GenericObject & params );
125  static AimsSurfaceTriangle* icosahedron( const Point3df & center,
126  float radius );
127 
128  static AimsSurfaceTriangle*
129  sphere( const carto::GenericObject & params );
130  static AimsSurfaceTriangle* sphere( const Point3df & p1, float radius,
131  unsigned nfacets,
132  bool uniquevertices = false );
133  static AimsSurfaceTriangle*
134  ellipse( const carto::GenericObject & params );
135  static AimsSurfaceTriangle* ellipse( const Point3df & p1, float radius1,
136  float radius2,
137  unsigned nfacets,
138  bool uniquevertices = false );
139  static AimsSurfaceTriangle*
140  icosphere( const carto::GenericObject & params );
141  static AimsSurfaceTriangle* icosphere( const Point3df & center,
142  float radius, unsigned nfacets );
143 
147  const Point3df & boundingbox_min, const Point3df & boundingbox_max );
148 
149  static AimsSurfaceTriangle*
150  parallelepiped( const carto::GenericObject & params );
152  const Point3df & boundingbox_min, const Point3df & boundingbox_max,
153  bool smooth = false );
154 
156  circle_wireframe( const carto::GenericObject & params );
166  const Point3df & center, float radius, unsigned nseg=20,
167  const Point3df & normal = Point3df( 0, 0, 1 ),
168  const Point3df & startdir = Point3df( 1, 0, 0 ), float startangle = 0,
169  float stopangle = M_PI*2 );
170 
172  grid( const carto::GenericObject & params );
173 
178  const Point3df & boundingbox_min, const Point3df & boundingbox_max,
179  const Point3df & grid_sampling );
180  };
181 
182 }
183 
184 
185 #endif
static AimsTimeSurface< 2, Void > * circle_wireframe(const carto::GenericObject &params)
static carto::Object description_wireframe()
static carto::Object description()
description of known shapes and parameters (vector of dicts)
static AimsSurfaceTriangle * cylinder(const carto::GenericObject &params)
static void printDescription(std::ostream &s=std::cout)
outputs the description() dictionary in a more huma-readable way
AIMSDATA_API AimsTimeSurface< 3, Void > AimsSurfaceTriangle
Definition: surface.h:547
virtual carto::Object parameters() const =0
static AimsSurfaceTriangle * cube(const carto::GenericObject &params)
The class for EcatSino data write operation.
Definition: border.h:42
static AimsTimeSurface< 2, Void > * parallelepiped_wireframe(const carto::GenericObject &params)
virtual AimsSurfaceTriangle * generator(const carto::GenericObject &) const =0
static AimsSurfaceTriangle * icosahedron(const carto::GenericObject &params)
Sphere generation functions by Manik Bhattacharjee (CNRS UPR640 - LENA)
static AimsSurfaceTriangle * parallelepiped(const carto::GenericObject &params)
static AimsSurfaceTriangle * ellipse(const carto::GenericObject &params)
static AimsSurfaceTriangle * icosphere(const carto::GenericObject &params)
static void printDescription_wireframe(std::ostream &s=std::cout)
static AimsSurfaceTriangle * arrow(const carto::GenericObject &params)
static AimsTimeSurface< 2, Void > * grid(const carto::GenericObject &params)
Factory class for various common shapes of meshes.
Definition: surfacegen.h:45
static AimsSurfaceTriangle * cone(const carto::GenericObject &params)
static AimsSurfaceTriangle * generate(const carto::GenericObject &params)
generic factory function (calls lower-level functions)
static AimsTimeSurface< 2, Void > * generate_wireframe(const carto::GenericObject &params)
static AimsSurfaceTriangle * sphere(const carto::GenericObject &params)