25 #ifndef WMWRITEMESH_TEST_H
26 #define WMWRITEMESH_TEST_H
32 #include <cxxtest/TestSuite.h>
34 #include "../WMWriteMesh.h"
35 #include "core/common/WIOTools.h"
36 #include "core/common/WLogger.h"
37 #include "core/common/math/linearAlgebra/WPosition.h"
38 #include "core/graphicsEngine/WTriangleMesh.h"
68 std::shared_ptr< WTriangleMesh > triMesh(
new WTriangleMesh( 0, 0 ) );
70 std::string fileName = tempFilename().string();
77 TS_ASSERT_EQUALS( result,
false );
78 TS_ASSERT( !fileExists( fileName ) );
87 const unsigned int nbPos = 10;
88 std::shared_ptr< WTriangleMesh > triMesh(
new WTriangleMesh( nbPos, 3 ) );
91 std::vector< WPosition > vertices( 0 );
92 for(
unsigned int posId = 0; posId < nbPos; ++posId )
94 double x = posId * posId + 3.4;
96 double z = 3. /
static_cast< double >( posId );
97 triMesh->addVertex( x, y, z );
100 std::string fileName = tempFilename().string();
109 TS_ASSERT_EQUALS( result,
false );
110 TS_ASSERT( !fileExists( fileName ) );
static void startup(std::ostream &output=std::cout, LogLevel level=LL_DEBUG)
Create the first and only instance of the logger as it is a singleton.
void testInstatiation()
Ensure instatiation does not throw and does initialization right.
void testSaveInfinteNan()
Test rejection of surfaces with nan or inf in coordinates for save.
void testSaveZero()
Test rejection of surfaces with zero triangles or vertices for save.
void setUp()
Setup method called before every test case.
This module writes the triangle mesh given at its input connector as a VTK ASCII file or ....
bool saveVTKASCII() const
Store the mesh in legacy vtk file format.
WPropFilename m_meshFile
The mesh will be written to this file.
std::shared_ptr< WTriangleMesh > m_triMesh
A pointer to the currently processed tri mesh.
WPropTrigger m_saveTriggerProp
This property triggers the actual writing,.
WPropGroup m_savePropGroup
Property group containing properties needed for saving the mesh.
std::shared_ptr< WProperties > m_properties
The property object for the module.
Class to manage properties of an object and to provide convenience methods for easy access and manipu...
Triangle mesh data structure allowing for convenient access of the elements.
@ PV_TRIGGER_READY
Trigger property: is ready to be triggered (again)