Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MeshTransform Class Reference

#include <MeshTransform.hpp>

Inheritance diagram for MeshTransform:
Collaboration diagram for MeshTransform:

Public Member Functions

 MeshTransform (Matrix3D &in_mat, Vector3D &in_vec, MsqError &err)
 
virtual ~MeshTransform ()
 
virtual double loop_over_mesh (MeshSet &ms, MsqError &err)
 Loop over the mesh and perform the affine transformation. More...
 
virtual msq_std::string get_name ()
 Return the name of this PatchDataUser: Mesh Transform. More...
 
virtual AlgorithmType get_algorithm_type ()
 Return the AlgorithmType of thsi PatchDataUser: MESH_TRANSFORM. More...
 
virtual void set_patch_type (PatchData::PatchType patch_type, MsqError &err, int param1, int param2)
 MeshTransform is built to use ELEMETNS_ON_VERTEX_PATCH with a depth one. More...
 
 MeshTransform (Matrix3D &in_mat, Vector3D &in_vec, MsqError &err)
 
virtual ~MeshTransform ()
 
virtual double loop_over_mesh (MeshSet &ms, MsqError &err)
 Loop over the mesh and perform the affine transformation. More...
 
virtual msq_std::string get_name ()
 Return the name of this PatchDataUser: Mesh Transform. More...
 
virtual AlgorithmType get_algorithm_type ()
 Return the AlgorithmType of thsi PatchDataUser: MESH_TRANSFORM. More...
 
virtual void set_patch_type (PatchData::PatchType patch_type, MsqError &err, int param1, int param2)
 MeshTransform is built to use ELEMETNS_ON_VERTEX_PATCH with a depth one. More...
 
- Public Member Functions inherited from PatchDataUser
virtual ~PatchDataUser ()
 
PatchData::PatchType get_patch_type ()
 Returns the Patch Type. More...
 
int get_nb_layers (MsqError &err)
 Returns number of layers (if relevant for partition algorythm). More...
 
void add_culling_method (enum PatchData::culling_method cm)
 Sets on the culling method passed as argument. More...
 
void no_culling_method ()
 Sets off all culling methods. More...
 
void remove_culling_method (enum PatchData::culling_method cm)
 Sets off the culling method passed as argument. More...
 
long unsigned int get_culling_method_bits ()
 Returns the bitset containing culling methods flags. More...
 
void set_all_parameters (PatchDataParameters &params)
 
PatchDataParametersget_all_parameters ()
 Returns the PatchDataParameters object. More...
 
void set_global_patch (PatchData *pd, MsqError &err)
 Sets the Global Patch, so that it can be use by contiguoug PatchDataUser. More...
 
PatchDataget_global_patch ()
 Returns the Global Patch. More...
 
void no_global_patch ()
 Sets the Global Patch pointer to NULL. More...
 
virtual ~PatchDataUser ()
 
PatchData::PatchType get_patch_type ()
 Returns the Patch Type. More...
 
int get_nb_layers (MsqError &err)
 Returns number of layers (if relevant for partition algorythm). More...
 
void add_culling_method (enum PatchData::culling_method cm)
 Sets on the culling method passed as argument. More...
 
void no_culling_method ()
 Sets off all culling methods. More...
 
void remove_culling_method (enum PatchData::culling_method cm)
 Sets off the culling method passed as argument. More...
 
long unsigned int get_culling_method_bits ()
 Returns the bitset containing culling methods flags. More...
 
void set_all_parameters (PatchDataParameters &params)
 
PatchDataParametersget_all_parameters ()
 Returns the PatchDataParameters object. More...
 
void set_global_patch (PatchData *pd, MsqError &err)
 Sets the Global Patch, so that it can be use by contiguoug PatchDataUser. More...
 
PatchDataget_global_patch ()
 Returns the Global Patch. More...
 
void no_global_patch ()
 Sets the Global Patch pointer to NULL. More...
 

Private Attributes

Matrix3D mMat
 
Vector3D mVec
 Matrix for the affine transformation. More...
 

Additional Inherited Members

- Public Types inherited from PatchDataUser
enum  AlgorithmType {
  QUALITY_IMPROVER, QUALITY_ASSESSOR, MESH_TRANSFORM, TARGET_CALCULATOR,
  QUALITY_IMPROVER, QUALITY_ASSESSOR, MESH_TRANSFORM, TARGET_CALCULATOR
}
 
enum  AlgorithmType {
  QUALITY_IMPROVER, QUALITY_ASSESSOR, MESH_TRANSFORM, TARGET_CALCULATOR,
  QUALITY_IMPROVER, QUALITY_ASSESSOR, MESH_TRANSFORM, TARGET_CALCULATOR
}
 
- Protected Member Functions inherited from PatchDataUser
 PatchDataUser ()
 
 PatchDataUser ()
 

Detailed Description

Perform an Affine transformation on Mesh vertex positions. Essentially define the new vertex position, v_new, from the original vertex position, v_old, s.t. v_new = (mMat * v_old) + mVec, where mMat is a constant matrix and mVec is a constant vector.

Definition at line 58 of file includeLinks/MeshTransform.hpp.

Constructor & Destructor Documentation

MeshTransform ( Matrix3D in_mat,
Vector3D in_vec,
MsqError err 
)

Constructor sets the matrix and the vector for the affine transformation. It also sets the patch type and culling method. My default the patches are just created such that a patch is created around each vertex but no elements are added to the patch (each patch consists of a single vertex, ELEMENTS_ON_VERTEX_PATCH with a layer depth of 1).

Definition at line 50 of file Misc/MeshTransform.cpp.

References PatchData::ELEMENTS_ON_VERTEX_PATCH, MeshTransform::mMat, MeshTransform::mVec, PatchDataUser::no_culling_method(), and MeshTransform::set_patch_type().

51  {
52  mMat = in_mat;
53  mVec = in_vec;
56  }
virtual void set_patch_type(PatchData::PatchType patch_type, MsqError &err, int param1, int param2)
MeshTransform is built to use ELEMETNS_ON_VERTEX_PATCH with a depth one.
Vector3D mVec
Matrix for the affine transformation.
void no_culling_method()
Sets off all culling methods.

Here is the call graph for this function:

virtual ~MeshTransform ( )
inlinevirtual

Definition at line 64 of file includeLinks/MeshTransform.hpp.

64 { };
MeshTransform ( Matrix3D in_mat,
Vector3D in_vec,
MsqError err 
)
virtual ~MeshTransform ( )
inlinevirtual

Definition at line 64 of file src/Misc/MeshTransform.hpp.

64 { };

Member Function Documentation

virtual AlgorithmType get_algorithm_type ( )
inlinevirtual

Return the AlgorithmType of thsi PatchDataUser: MESH_TRANSFORM.

Implements PatchDataUser.

Definition at line 71 of file includeLinks/MeshTransform.hpp.

References PatchDataUser::MESH_TRANSFORM.

virtual AlgorithmType get_algorithm_type ( )
inlinevirtual

Return the AlgorithmType of thsi PatchDataUser: MESH_TRANSFORM.

Implements PatchDataUser.

Definition at line 71 of file src/Misc/MeshTransform.hpp.

References PatchDataUser::MESH_TRANSFORM.

virtual msq_std::string get_name ( )
inlinevirtual

Return the name of this PatchDataUser: Mesh Transform.

Implements PatchDataUser.

Definition at line 69 of file includeLinks/MeshTransform.hpp.

69 { return "Mesh Transform.";}
virtual msq_std::string get_name ( )
inlinevirtual

Return the name of this PatchDataUser: Mesh Transform.

Implements PatchDataUser.

Definition at line 69 of file src/Misc/MeshTransform.hpp.

69 { return "Mesh Transform.";}
virtual double loop_over_mesh ( MeshSet ms,
MsqError err 
)
virtual

Loop over the mesh and perform the affine transformation.

Implements PatchDataUser.

double loop_over_mesh ( MeshSet ms,
MsqError err 
)
virtual

Loop over the mesh and perform the affine transformation.

Actually apply the affine transformation

Parameters
constMeshSet &: this MeshSet is looped over. Only the mutable data members are changed (such as currentVertexInd).

Implements PatchDataUser.

Definition at line 72 of file Misc/MeshTransform.cpp.

References PatchData::ELEMENTS_ON_VERTEX_PATCH, MeshSet::get_next_patch(), PatchDataUser::get_patch_type(), PatchData::get_vertex_array(), MsqError::INVALID_STATE, MeshTransform::mMat, MSQ_SETERR, MeshTransform::mVec, PatchData::num_vertices(), and PatchData::update_mesh().

73  {
74  //This shouldn't be an issue, but make sure the patch type is still
75  //correct.
77  MSQ_SETERR(err)("Incorrect patch type being used.\n",
79  return 1.;
80  }
81  //get the first patch
82  PatchData patch_data;
83  bool next_patch=ms.get_next_patch(patch_data, this, err);
84  assert(!err);
85  if(err)
86  return 1.0;
87  //loop over the patches (ie, loop over the vertices.
88  while( next_patch )
89  {
90  //make sure we have a vertex.
91  if(patch_data.num_vertices()!=1){
92  MSQ_SETERR(err)( "Incorrect patch depth being used.",
94  return 1.;
95  }
96  MsqVertex* vert_array = patch_data.get_vertex_array(err);
97  if(err)
98  return 1.0;
99  //perform the affine transormation
100  Vector3D temp_vec = vert_array[0];
101  vert_array[0]=mMat*temp_vec+mVec;
102  //update the vertex postion
103  patch_data.update_mesh(err);
104  //get the next patch
105  next_patch = ms.get_next_patch(patch_data, this, err);
106  if(err)
107  return 1.0;
108  }
109  //return
110  return 0.;
111  }
NVec< 3, double > Vector3D
#define MSQ_SETERR(err)
Macro to set error - use err.clear() to clear.
PatchData::PatchType get_patch_type()
Returns the Patch Type.
Vector3D mVec
Matrix for the affine transformation.
object is in an invalid state

Here is the call graph for this function:

virtual void set_patch_type ( PatchData::PatchType  patch_type,
MsqError err,
int  param1,
int  param2 
)
virtual

MeshTransform is built to use ELEMETNS_ON_VERTEX_PATCH with a depth one.

We implement set_patch_type to ensure this is the patch that is used.

Reimplemented from PatchDataUser.

void set_patch_type ( PatchData::PatchType  patch_type,
MsqError err,
int  param1 = 0,
int  param2 = 0 
)
virtual

MeshTransform is built to use ELEMETNS_ON_VERTEX_PATCH with a depth one.

We implement set_patch_type to ensure this is the patch that is used.

Reimplemented from PatchDataUser.

Definition at line 57 of file Misc/MeshTransform.cpp.

References PatchData::ELEMENTS_ON_VERTEX_PATCH, MsqError::INVALID_ARG, MSQ_SETERR, and PatchDataUser::set_patch_type().

Referenced by MeshTransform::MeshTransform().

58  {
59  if(patch_type != PatchData::ELEMENTS_ON_VERTEX_PATCH ||
60  param1 != 0){
61  MSQ_SETERR(err)("Patch type must be ELEMENTS_ON_VERTEX_PATCH, depth 1.\n", MsqError::INVALID_ARG);
62  }
64  0, param2);
65  }
virtual void set_patch_type(PatchData::PatchType patch_type, MsqError &err, int param1=0, int param2=0)
Sets the Patch Type.
invalid function argument passed
#define MSQ_SETERR(err)
Macro to set error - use err.clear() to clear.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

Vector3D mVec
private

Matrix for the affine transformation.

Definition at line 80 of file includeLinks/MeshTransform.hpp.

Referenced by MeshTransform::loop_over_mesh(), and MeshTransform::MeshTransform().


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