Skip to content
Snippets Groups Projects
Commit 4ce617f1 authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

OptHOM : export parametric coordinates

parent 430d2043
No related branches found
No related tags found
No related merge requests found
...@@ -316,9 +316,10 @@ void Mesh::distSqToStraight(std::vector<double> &dSq) ...@@ -316,9 +316,10 @@ void Mesh::distSqToStraight(std::vector<double> &dSq)
void Mesh::updateGEntityPositions() void Mesh::updateGEntityPositions()
{ {
for (int iV = 0; iV < nVert(); iV++)
for (int iV = 0; iV < nVert(); iV++) _vert[iV]->setXYZ(_xyz[iV].x(),_xyz[iV].y(),_xyz[iV].z()); _vert[iV]->setXYZ(_xyz[iV].x(),_xyz[iV].y(),_xyz[iV].z());
for (int iFV = 0; iFV < nFV(); iFV++)
_pc->exportParamCoord(_freeVert[iFV], _uvw[iFV]);
} }
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
#include "MVertex.h" #include "MVertex.h"
#include "ParamCoord.h" #include "ParamCoord.h"
ParamCoordSurf::ParamCoordSurf(GEntity *ge) ParamCoordSurf::ParamCoordSurf(GEntity *ge)
{ {
if ((ge->dim() == 2) && (ge->geomType() != GEntity::DiscreteSurface)) _gf = static_cast<GFace*>(ge); if ((ge->dim() == 2) && (ge->geomType() != GEntity::DiscreteSurface)) _gf = static_cast<GFace*>(ge);
...@@ -172,3 +170,10 @@ void ParamCoordParent::gXyz2gUvw(MVertex* vert, const SPoint3 &uvw, const std::v ...@@ -172,3 +170,10 @@ void ParamCoordParent::gXyz2gUvw(MVertex* vert, const SPoint3 &uvw, const std::v
} }
} }
void ParamCoordParent::exportParamCoord(MVertex *v, const SPoint3 &uvw)
{
for (int d = 0; d < v->onWhat()->dim(); ++d) {
v->setParameter(d, uvw[d]);
}
}
...@@ -8,6 +8,7 @@ class ParamCoord ...@@ -8,6 +8,7 @@ class ParamCoord
public: public:
virtual void exportParamCoord(MVertex *v, const SPoint3 &uvw) {};
virtual int nCoord(MVertex* vert) = 0; // Number of parametric coordinates for vertex virtual int nCoord(MVertex* vert) = 0; // Number of parametric coordinates for vertex
virtual SPoint3 getUvw(MVertex* vert) = 0; // Get parametric coordinates of vertex virtual SPoint3 getUvw(MVertex* vert) = 0; // Get parametric coordinates of vertex
virtual SPoint3 uvw2Xyz(MVertex* vert, const SPoint3 &uvw) = 0; // Calculate physical coordinates from parametric coordinates of vertex virtual SPoint3 uvw2Xyz(MVertex* vert, const SPoint3 &uvw) = 0; // Calculate physical coordinates from parametric coordinates of vertex
...@@ -89,6 +90,7 @@ class ParamCoordParent : public ParamCoord ...@@ -89,6 +90,7 @@ class ParamCoordParent : public ParamCoord
public: public:
int nCoord(MVertex* vert) { return vert->onWhat()->dim(); } int nCoord(MVertex* vert) { return vert->onWhat()->dim(); }
virtual void exportParamCoord(MVertex *v, const SPoint3 &uvw);
virtual SPoint3 getUvw(MVertex* vert); virtual SPoint3 getUvw(MVertex* vert);
virtual SPoint3 uvw2Xyz(MVertex* vert, const SPoint3 &uvw); virtual SPoint3 uvw2Xyz(MVertex* vert, const SPoint3 &uvw);
virtual void gXyz2gUvw(MVertex* vert, const SPoint3 &uvw, const SPoint3 &gXyz, SPoint3 &gUvw); virtual void gXyz2gUvw(MVertex* vert, const SPoint3 &uvw, const SPoint3 &gXyz, SPoint3 &gUvw);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment