Buongiorno a tutti! Ho preso il trianglerefine.hpp aggiornato che è il seguente:
#ifndef TRIANGLEREFINER_HPP
#define TRIANGLEREFINER_HPP
#include "GenericDomain.hpp"
#include "GenericMesh.hpp"
#include "Eigen/Eigen"
using namespace std;
using namespace Eigen;
namespace GeDiM
{
class TriangleRefiner
{
protected:
GenericMesh* meshPointer;
vector<unsigned int> idCellsToRefine;
vector<const GenericEdge*> RefinedEdge;
vector<const GenericEdge*> MarkedEdge;
int cntTagli;
public:
TriangleRefiner() { meshPointer = NULL; cntTagli=0;}
~TriangleRefiner() { }
void SetMesh( GenericMesh& mesh ) { meshPointer = &mesh; }
void SetNumberCellsToRefine( const unsigned int& value ) { idCellsToRefine.reserve(value); }
void AddCellId( const unsigned int& value ) { idCellsToRefine.push_back(value); }
void LongestEdgeSort(const unsigned int& value, bool tol);
int getCntTagli(){return cntTagli;};
Output::ExitCodes RefineMesh(bool tol); // l'errore di main.cpp ha a che fare con questo (ATTENZIONE!!!) note 1) e 2)//
Output::ExitCodes RefineTriangle(const unsigned int& value, bool tol);
};
}
#endif
Adesso non ci sono più 5 errori ma 1ERRORE SOLTANTO e precisamente ha a che fare con il main.cpp qui di seguito:
#include "GenericDomain.hpp"
#include "GenericMesh.hpp"
#include "MeshImport_Triangle.hpp"
#include <iostream>
#include "TriangleRefiner.hpp"
using namespace GeDiM;
using namespace Eigen;
int main(int argc, char** argv)
{
/// CREATE DOMAIN
const unsigned int numDomainVertices = 4;
GenericDomain2D domain(0,numDomainVertices);
vector<Vector3d> vertexCoords(numDomainVertices);
vertexCoords[0] << 0.0, 0.0, 0.0;
vertexCoords[1] << 1.0, 0.0, 0.0;
vertexCoords[2] << 1.0, 1.0, 0.0;
vertexCoords[3] << 0.0, 1.0, 0.0;
for(unsigned int i = 0; i < numDomainVertices; i++)
{
domain.AddVertex(vertexCoords);
domain.AddEdge(i, (i+1)%numDomainVertices);
}
domain.Initialize();
/// MESH DOMAIN
MeshImport_Triangle meshCreator;
meshCreator.SetMaximumCellSize(1e-2);
meshCreator.CreateTriangleInput(domain);
meshCreator.CreateTriangleOutput(domain);
GenericMesh mesh;
meshCreator.CreateMesh(domain, mesh);
Output::PrintGenericMessage("Triangle ha prodotto una mesh contenente %d triangoli, %d nodi e %d lati", true, mesh.NumberOfCells(), mesh.NumberOfPoints(), mesh.NumberOfEdges());
/// REFINE MESH
TriangleRefiner refiner;
refiner.SetMesh(mesh);
refiner.SetNumberCellsToRefine(1);
refiner.AddCellId(16);
refiner.RefineMesh(); // qui da errore (ATTENZIONE!!!) // Eroore vero e proprio 3)
/// OUTPUT MESH TO MATLAB SCRIPT FOR VISUALIZATION
ofstream file("plotTriangleMesh.m", ofstream::out);
file << "nodes = [";
for(unsigned int i = 0; i < mesh.NumberOfPoints(); i++)
file << mesh.Point(i)->Coordinates()(0) << "," << mesh.Point(i)->Coordinates()(1) << ";" << endl;
file << "];" << endl;
file << "triangles = [";
for(unsigned int i = 0; i < mesh.NumberOfCells(); i++)
{
file << mesh.Cell(i)->Point(0)->Id()+1 << "," << mesh.Cell(i)->Point(1)->Id()+1 << "," << mesh.Cell(i)->Point(2)->Id()+1 << ";" << endl;
}
file << "];" << endl;
file << "trimesh(triangles, nodes(:,1), nodes(:,2));" << endl;
file.close();
}
E più precisamente;
3)E:\progettoCppWin\progettoCppWin\ProgettoCppWin\main.cpp|41|error: no matching function for call to 'GeDiM::TriangleRefiner::RefineMesh()'|
Poi mette due note come:
1)E:\progettoCppWin\progettoCppWin\ProgettoCppWin\TriangleRefiner.hpp|33|note: candidate: MainApplication::Output::ExitCodes GeDiM::TriangleRefiner::RefineMesh(bool)|
2)E:\progettoCppWin\progettoCppWin\ProgettoCppWin\TriangleRefiner.hpp|33|note: candidate expects 1 argument, 0 provided|
Secondo voi come potrebbe essere?
Buona giornata!