Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Remesher_Simmetrix.h
Go to the documentation of this file.
1 /* *******************************************************************
2  * Rocstar Simulation Suite *
3  * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4  * *
5  * Illinois Rocstar LLC *
6  * Champaign, IL *
7  * www.illinoisrocstar.com *
8  * sales@illinoisrocstar.com *
9  * *
10  * License: See LICENSE file in top level of distribution package or *
11  * http://opensource.org/licenses/NCSA *
12  *********************************************************************/
13 /* *******************************************************************
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17  * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21  * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22  *********************************************************************/
23 // $Id: Remesher_Simmetrix.h,v 1.4 2008/12/06 08:45:27 mtcampbe Exp $
24 
25 #ifndef _REMESHING_SIMMETRIX_H_
26 #define _REMESHING_SIMMETRIX_H_
27 
28 #include "Rocprop.h"
29 
31 
32 // A serial remesher for triangular surface meshes based on Simmetrix tools.
34 
35 public:
36  // Initialize the remesher (in particular, MeshSim).
37  explicit Remesher_Simmetrix(const char *logfile=NULL);
38 
39  // Finalize the remesher (in particular, MeshSim).
40  virtual ~Remesher_Simmetrix();
41 
42  // Main entry for remeshing.
43  virtual void remesh_serial( Manifold *wm, COM::Attribute *mesh_out,
44  double lave, double fangle);
45 
46  // Set global mesh size. See MS_setGlobalMeshSize() of MeshSim for
47  // the semantics of the parameters.
48  void set_global_mesh_size( int type, double val)
49  { _size_type = type; _size_val = val; }
50 
51  // Set feature angle (in degrees). If 0 (the default),
52  // then no feature detection is performed.
53  void set_fangle( double fangle) { _fangle = fangle; }
54 
55  // Set short ratio. See DM_modifySurfaceMesh() of GeomSim for
56  // the semantics of the parameter.
57  void set_short_ratio( double r) { _shrtRatio = r; }
58 
59 protected:
60  // Convert a window object into a MeshSim object
61  void *window_to_simmesh( const COM::Window *outwin);
62 
63  // Convert a MeshSim object into a window
64  void simmesh_to_window( void *mesh, COM::Window *outwin);
65 
66 protected:
67  static int instances; // Number of instances of the remesher
68  int _size_type; // Type of mesh size
69  double _size_val; // Value of mesh size
70  double _fangle; // Feature angle
71  double _shrtRatio; // Collapse an edge if it is incident on an edge
72  // that is at least _shrtRatio times as long
73 };
74 
76 
77 #endif
78 
79 
80 
81 
82 
83 
#define PROP_END_NAMESPACE
Definition: propbasic.h:29
#define PROP_BEGIN_NAMESPACE
Definition: propbasic.h:28
void set_fangle(double fangle)
static int instances
This file provides a wrapper to invoke GeomSim from Simmetrix to remesh a surface mesh...
Remesher_Simmetrix(const char *logfile=NULL)
Initialize the remesher.
virtual void remesh_serial(Manifold *wm, COM::Attribute *mesh_out, double lave, double fangle)
SURF::Window_manifold_2 Manifold
Definition: propbasic.h:46
void set_global_mesh_size(int type, double val)
virtual ~Remesher_Simmetrix()
Finalize the remesher.
void set_short_ratio(double r)
void simmesh_to_window(void *mesh, COM::Window *outwin)
void * window_to_simmesh(const COM::Window *outwin)