Skip to content
Snippets Groups Projects
Commit bc387133 authored by Jean-François Remacle's avatar Jean-François Remacle
Browse files

added ReadImg.* into Graphics
modified Makefiles (now libfltk_images.a is used)
This is a beta version of image loading with gmsh
parent 4eec761b
No related branches found
No related tags found
No related merge requests found
# $Id: Makefile,v 1.42 2003-02-11 08:54:56 geuzaine Exp $ # $Id: Makefile,v 1.43 2003-02-12 09:20:41 remacle Exp $
include ../variables include ../variables
...@@ -14,6 +14,7 @@ SRC = Draw.cpp \ ...@@ -14,6 +14,7 @@ SRC = Draw.cpp \
PostElement.cpp \ PostElement.cpp \
Iso.cpp \ Iso.cpp \
Entity.cpp \ Entity.cpp \
ReadImg.cpp \
Visibility.cpp \ Visibility.cpp \
Scale.cpp \ Scale.cpp \
Graph2D.cpp \ Graph2D.cpp \
......
// $Id: 2D_Mesh_Aniso.cpp,v 1.30 2003-01-23 20:19:21 geuzaine Exp $ // $Id: 2D_Mesh_Aniso.cpp,v 1.31 2003-02-12 09:20:41 remacle Exp $
// //
// Copyright (C) 1997 - 2003 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997 - 2003 C. Geuzaine, J.-F. Remacle
// //
...@@ -69,10 +69,17 @@ static int ZONEELIMINEE, Methode = 0; ...@@ -69,10 +69,17 @@ static int ZONEELIMINEE, Methode = 0;
static double volume; static double volume;
static List_T *coquille; static List_T *coquille;
static Edge *THEEDGE; static Edge *THEEDGE;
extern void LCBGM (double X, double Y, double Z, double *l);
double Interpole_lcTriangle (Simplex * s, Vertex * vv){ double Interpole_lcTriangle (Simplex * s, Vertex * vv){
double Xp, Yp, X[3], Y[3], det, u, v, q1, q2, q3; double Xp, Yp, X[3], Y[3], det, u, v, q1, q2, q3;
if (THEM->BGM.Typ == ONFILE)
{
double LL;
LCBGM (vv->Pos.X,vv->Pos.Y,0.0,&LL);
return LL * CTX.mesh.lc_factor;
}
Xp = vv->Pos.X; Xp = vv->Pos.X;
Yp = vv->Pos.Y; Yp = vv->Pos.Y;
......
// $Id: 3D_Mesh.cpp,v 1.45 2003-01-23 20:19:22 geuzaine Exp $ // $Id: 3D_Mesh.cpp,v 1.46 2003-02-12 09:20:41 remacle Exp $
// //
// Copyright (C) 1997 - 2003 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997 - 2003 C. Geuzaine, J.-F. Remacle
// //
...@@ -48,7 +48,7 @@ extern int FACE_DIMENSION; ...@@ -48,7 +48,7 @@ extern int FACE_DIMENSION;
static Tree_T *Tsd, *Sim_Sur_Le_Bord, *POINTS_TREE; static Tree_T *Tsd, *Sim_Sur_Le_Bord, *POINTS_TREE;
static List_T *Simplexes_Destroyed, *Simplexes_New, *Suppress; static List_T *Simplexes_Destroyed, *Simplexes_New, *Suppress;
static List_T *LLL, *POINTS; static List_T *LLL, *POINTS_LIST;
static Simplex *THES; static Simplex *THES;
static Vertex *THEV; static Vertex *THEV;
static Tree_T *SimXFac; static Tree_T *SimXFac;
...@@ -125,7 +125,7 @@ void add_points (void *a, void *b){ ...@@ -125,7 +125,7 @@ void add_points (void *a, void *b){
} }
void add_points_2 (void *a, void *b){ void add_points_2 (void *a, void *b){
List_Add (POINTS, a); List_Add (POINTS_LIST, a);
} }
...@@ -769,7 +769,7 @@ void Convex_Hull_Mesh (List_T * Points, Mesh * m){ ...@@ -769,7 +769,7 @@ void Convex_Hull_Mesh (List_T * Points, Mesh * m){
THEV->Pos.Z -= dz; THEV->Pos.Z -= dz;
if(count > 5){ if(count > 5){
N++; N++;
List_Add(POINTS,&THEV); List_Add(POINTS_LIST,&THEV);
Msg(WARNING, "Unable to add point %d (will try it later)", THEV->Num); Msg(WARNING, "Unable to add point %d (will try it later)", THEV->Num);
break; break;
} }
...@@ -865,7 +865,7 @@ void Maillage_Volume (void *data, void *dum){ ...@@ -865,7 +865,7 @@ void Maillage_Volume (void *data, void *dum){
s = &S; s = &S;
POINTS_TREE = Tree_Create (sizeof (Vertex *), comparePosition); POINTS_TREE = Tree_Create (sizeof (Vertex *), comparePosition);
POINTS = List_Create (100, 100, sizeof (Vertex *)); POINTS_LIST = List_Create (100, 100, sizeof (Vertex *));
LOCAL->Simplexes = v->Simplexes; LOCAL->Simplexes = v->Simplexes;
LOCAL->Vertices = v->Vertices; LOCAL->Vertices = v->Vertices;
...@@ -876,7 +876,7 @@ void Maillage_Volume (void *data, void *dum){ ...@@ -876,7 +876,7 @@ void Maillage_Volume (void *data, void *dum){
Tree_Action (POINTS_TREE, add_points_2); Tree_Action (POINTS_TREE, add_points_2);
Tree_Delete (POINTS_TREE); Tree_Delete (POINTS_TREE);
N = List_Nbr (POINTS); N = List_Nbr (POINTS_LIST);
n = N / 30 + 1; n = N / 30 + 1;
if(!N) return; if(!N) return;
...@@ -885,7 +885,7 @@ void Maillage_Volume (void *data, void *dum){ ...@@ -885,7 +885,7 @@ void Maillage_Volume (void *data, void *dum){
Msg(STATUS2, "Mesh 3D... (initial)"); Msg(STATUS2, "Mesh 3D... (initial)");
Convex_Hull_Mesh (POINTS, LOCAL); Convex_Hull_Mesh (POINTS_LIST, LOCAL);
if(!Coherence (v, LOCAL)) if(!Coherence (v, LOCAL))
Msg(GERROR, "Surface recovery failed (send a bug report with the geo file to <gmsh@geuz.org>!)"); Msg(GERROR, "Surface recovery failed (send a bug report with the geo file to <gmsh@geuz.org>!)");
......
// $Id: OpenFile.cpp,v 1.37 2003-02-11 09:18:48 geuzaine Exp $ // $Id: OpenFile.cpp,v 1.38 2003-02-12 09:20:41 remacle Exp $
// //
// Copyright (C) 1997 - 2003 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997 - 2003 C. Geuzaine, J.-F. Remacle
// //
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "Views.h" #include "Views.h"
#include "MinMax.h" #include "MinMax.h"
#include "Visibility.h" #include "Visibility.h"
#include "ReadImg.h"
#ifndef _BLACKBOX #ifndef _BLACKBOX
#include "GmshUI.h" #include "GmshUI.h"
...@@ -105,8 +106,24 @@ void ParseString(char *str){ ...@@ -105,8 +106,24 @@ void ParseString(char *str){
} }
} }
void MergeProblem(char *name){
ParseFile(name,0); int MergeProblem(char *name){
char ext[5];
strncpy (ext,&name[strlen(name)-4],5);
/// a jpg file is used as an inpu, we transform it onto
/// a post pro file that could be used as a background mesh
if(!strcmp(ext,".ppm") ||!strcmp(ext,".pnm"))
{
read_pnm (name);
return 1;
}
else
{
return ParseFile(name,0);
}
} }
void MergeProblemWithBoundingBox(char *name){ void MergeProblemWithBoundingBox(char *name){
...@@ -146,6 +163,7 @@ void OpenProblem(char *name){ ...@@ -146,6 +163,7 @@ void OpenProblem(char *name){
!strcmp(ext,".msh") || !strcmp(ext,".MSH") || !strcmp(ext,".msh") || !strcmp(ext,".MSH") ||
!strcmp(ext,".stl") || !strcmp(ext,".STL") || !strcmp(ext,".stl") || !strcmp(ext,".STL") ||
!strcmp(ext,".sms") || !strcmp(ext,".SMS") || !strcmp(ext,".sms") || !strcmp(ext,".SMS") ||
!strcmp(ext,".ppm") || !strcmp(ext,".pnm") ||
!strcmp(ext,".pos") || !strcmp(ext,".POS")){ !strcmp(ext,".pos") || !strcmp(ext,".POS")){
CTX.base_filename[strlen(name)-4] = '\0'; CTX.base_filename[strlen(name)-4] = '\0';
} }
...@@ -161,7 +179,8 @@ void OpenProblem(char *name){ ...@@ -161,7 +179,8 @@ void OpenProblem(char *name){
int nb = List_Nbr(CTX.post.list); int nb = List_Nbr(CTX.post.list);
int status = ParseFile(CTX.filename,0); int status = MergeProblem(CTX.filename);
//ParseFile(CTX.filename,0);
ApplyLcFactor(THEM); ApplyLcFactor(THEM);
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
int ParseFile(char *filename, int silent); int ParseFile(char *filename, int silent);
void ParseString(char *str); void ParseString(char *str);
void OpenProblem(char *filename); void OpenProblem(char *filename);
void MergeProblem(char *filename); int MergeProblem(char *filename);
void MergeProblemWithBoundingBox(char *filename); void MergeProblemWithBoundingBox(char *filename);
void SystemCall(char *command); void SystemCall(char *command);
......
...@@ -12,5 +12,5 @@ Line(3) = {1,4}; ...@@ -12,5 +12,5 @@ Line(3) = {1,4};
Line(4) = {4,3}; Line(4) = {4,3};
Line Loop(5) = {1,2,3,4}; Line Loop(5) = {1,2,3,4};
Plane Surface(6) = {5}; Plane Surface(6) = {5};
Attractor Point{2} = {0.05,0.05,2}; //Attractor Point{2} = {0.05,0.05,2};
Mesh.Algorithm = 2; //Mesh.Algorithm = 2;
...@@ -3,7 +3,7 @@ Square non uniformly ...@@ -3,7 +3,7 @@ Square non uniformly
meshed meshed
******************************/ ******************************/
lc = .1; lc = .1;
Point(1) = {0.0,0.0,0,lc*.1}; Point(1) = {0.0,0.0,0,lc*.01};
Point(2) = {1,0.0,0,lc}; Point(2) = {1,0.0,0,lc};
Point(3) = {1,1,0,lc}; Point(3) = {1,1,0,lc};
Point(4) = {0,1,0,lc}; Point(4) = {0,1,0,lc};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment