Skip to content
Snippets Groups Projects
Commit a81c25ff authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

move DivideAndConquer to mesh module, since it now depends plenty of GModel

parent 7d01aacb
No related branches found
No related tags found
No related merge requests found
...@@ -10,11 +10,15 @@ ...@@ -10,11 +10,15 @@
#include <math.h> #include <math.h>
#include <time.h> #include <time.h>
#include <stdlib.h> #include <stdlib.h>
#include "GmshConfig.h"
#include "SOrientedBoundingBox.h" #include "SOrientedBoundingBox.h"
#include "fullMatrix.h" #include "fullMatrix.h"
#include "DivideAndConquer.h"
#include "SBoundingBox3d.h" #include "SBoundingBox3d.h"
#if defined(HAVE_MESH)
#include "DivideAndConquer.h"
#endif
double SOrientedBoundingRectangle::area() double SOrientedBoundingRectangle::area()
{ {
double b = size->at(0); double b = size->at(0);
...@@ -201,6 +205,7 @@ bool SOrientedBoundingBox::intersects(SOrientedBoundingBox& obb) ...@@ -201,6 +205,7 @@ bool SOrientedBoundingBox::intersects(SOrientedBoundingBox& obb)
SOrientedBoundingBox* SOrientedBoundingBox::buildOBB(std::vector<SPoint3> vertices) SOrientedBoundingBox* SOrientedBoundingBox::buildOBB(std::vector<SPoint3> vertices)
{ {
#if defined(HAVE_MESH)
int num_vertices = vertices.size(); int num_vertices = vertices.size();
// First organize the data // First organize the data
fullMatrix<double> data(3,num_vertices); fullMatrix<double> data(3,num_vertices);
...@@ -547,6 +552,10 @@ SOrientedBoundingBox* SOrientedBoundingBox::buildOBB(std::vector<SPoint3> vertic ...@@ -547,6 +552,10 @@ SOrientedBoundingBox* SOrientedBoundingBox::buildOBB(std::vector<SPoint3> vertic
*/ */
return (new SOrientedBoundingBox(center, return (new SOrientedBoundingBox(center,
size[0], size[1], size[2], Axis1, Axis2, Axis3)); size[0], size[1], size[2], Axis1, Axis2, Axis3));
#else
Msg::Error("SOrientedBoundingBox requires mesh module");
return 0;
#endif
} }
double SOrientedBoundingBox::compare(SOrientedBoundingBox& obb1, SOrientedBoundingBox& obb2) double SOrientedBoundingBox::compare(SOrientedBoundingBox& obb1, SOrientedBoundingBox& obb2)
......
...@@ -32,6 +32,7 @@ CenterlineField.cpp ...@@ -32,6 +32,7 @@ CenterlineField.cpp
QuadTriUtils.cpp QuadTriUtils.cpp
QuadTriExtruded2D.cpp QuadTriExtruded3D.cpp QuadTriTransfinite3D.cpp QuadTriExtruded2D.cpp QuadTriExtruded3D.cpp QuadTriTransfinite3D.cpp
simple3D.cpp simple3D.cpp
DivideAndConquer.cpp
Voronoi3D.cpp Voronoi3D.cpp
Levy3D.cpp Levy3D.cpp
periodical.cpp periodical.cpp
......
File moved
File moved
...@@ -23,7 +23,6 @@ set(SRC ...@@ -23,7 +23,6 @@ set(SRC
robustPredicates.cpp robustPredicates.cpp
mathEvaluator.cpp mathEvaluator.cpp
Iso.cpp Iso.cpp
DivideAndConquer.cpp
) )
file(GLOB HDR RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.h) file(GLOB HDR RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.h)
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
// bugs and problems to <gmsh@geuz.org>. // bugs and problems to <gmsh@geuz.org>.
#include <vector> #include <vector>
#include "GmshConfig.h"
#include "GModel.h" #include "GModel.h"
#include "GmshMessage.h" #include "GmshMessage.h"
#include "Tetrahedralize.h" #include "Tetrahedralize.h"
......
...@@ -5,14 +5,18 @@ ...@@ -5,14 +5,18 @@
#include <vector> #include <vector>
#include <stdlib.h> #include <stdlib.h>
#include "GmshConfig.h"
#include "GModel.h" #include "GModel.h"
#include "discreteFace.h" #include "discreteFace.h"
#include "DivideAndConquer.h"
#include "GmshMessage.h" #include "GmshMessage.h"
#include "MVertex.h" #include "MVertex.h"
#include "Triangulate.h" #include "Triangulate.h"
#include "Context.h" #include "Context.h"
#if defined(HAVE_MESH)
#include "DivideAndConquer.h"
#endif
StringXNumber TriangulateOptions_Number[] = { StringXNumber TriangulateOptions_Number[] = {
{GMSH_FULLRC, "View", NULL, -1.} {GMSH_FULLRC, "View", NULL, -1.}
}; };
...@@ -70,6 +74,7 @@ static void project(MVertex *v, double mat[3][3]) ...@@ -70,6 +74,7 @@ static void project(MVertex *v, double mat[3][3])
PView *GMSH_TriangulatePlugin::execute(PView *v) PView *GMSH_TriangulatePlugin::execute(PView *v)
{ {
#if defined(HAVE_MESH)
int iView = (int)TriangulateOptions_Number[0].def; int iView = (int)TriangulateOptions_Number[0].def;
PView *v1 = getView(iView, v); PView *v1 = getView(iView, v);
...@@ -176,4 +181,8 @@ PView *GMSH_TriangulatePlugin::execute(PView *v) ...@@ -176,4 +181,8 @@ PView *GMSH_TriangulatePlugin::execute(PView *v)
data2->finalize(); data2->finalize();
return v2; return v2;
#else
Msg::Error("Plugin(Triangulate) requires mesh module");
return v;
#endif
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment