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

fix compile

parent f44d6ebf
Branches
Tags
No related merge requests found
# $Id: Makefile,v 1.474 2008-03-11 20:03:09 geuzaine Exp $ # $Id: Makefile,v 1.475 2008-03-20 14:55:34 geuzaine Exp $
# #
# Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle # Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
# #
...@@ -24,7 +24,7 @@ include variables ...@@ -24,7 +24,7 @@ include variables
GMSH_MAJOR_VERSION = 2 GMSH_MAJOR_VERSION = 2
GMSH_MINOR_VERSION = 1 GMSH_MINOR_VERSION = 1
GMSH_PATCH_VERSION = 2 GMSH_PATCH_VERSION = 2
GMSH_EXTRA_VERSION = GMSH_EXTRA_VERSION = "-cvs-20080320"
GMSH_VERSION = ${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION}.${GMSH_PATCH_VERSION}${GMSH_EXTRA_VERSION} GMSH_VERSION = ${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION}.${GMSH_PATCH_VERSION}${GMSH_EXTRA_VERSION}
......
// $Id: Field.cpp,v 1.22 2008-03-20 10:21:15 remacle Exp $ // $Id: Field.cpp,v 1.23 2008-03-20 14:55:34 geuzaine Exp $
// //
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
// //
...@@ -91,7 +91,7 @@ FieldOptionInt(int &_val, bool * _status = NULL):FieldOption(_status), ...@@ -91,7 +91,7 @@ FieldOptionInt(int &_val, bool * _status = NULL):FieldOption(_status),
void numerical_value(double v) void numerical_value(double v)
{ {
modified(); modified();
val = v; val = (int)v;
}; };
void get_text_representation(std::string & v_str) void get_text_representation(std::string & v_str)
{ {
...@@ -134,18 +134,20 @@ FieldOptionList(std::list < int >&_val, bool * _status = NULL):FieldOption(_stat ...@@ -134,18 +134,20 @@ FieldOptionList(std::list < int >&_val, bool * _status = NULL):FieldOption(_stat
v_str = sstream.str(); v_str = sstream.str();
} }
}; };
class FieldOptionString:public FieldOption
{ class FieldOptionString : public FieldOption {
public: public:
std::string &val; std::string &val;
virtual FieldOptionType get_type() virtual FieldOptionType get_type()
{ {
return FIELD_OPTION_STRING; return FIELD_OPTION_STRING;
}; }
FieldOptionString(std::string & _val, bool * _status = NULL):FieldOption(_status), FieldOptionString(std::string &_val, bool *_status = NULL)
val(_val) { : FieldOption(_status), val(_val)
}; {
std::string & string() { }
std::string &string()
{
modified(); modified();
return val; return val;
} }
...@@ -160,26 +162,27 @@ FieldOptionString(std::string & _val, bool * _status = NULL):FieldOption(_status ...@@ -160,26 +162,27 @@ FieldOptionString(std::string & _val, bool * _status = NULL):FieldOption(_status
v_str = sstream.str(); v_str = sstream.str();
} }
}; };
class FieldOptionBool:public FieldOption
{ class FieldOptionBool : public FieldOption {
public: public:
bool &val; bool &val;
FieldOptionType get_type() FieldOptionType get_type()
{ {
return FIELD_OPTION_BOOL; return FIELD_OPTION_BOOL;
}; }
FieldOptionBool(bool & _val, bool * _status = NULL):FieldOption(_status), FieldOptionBool(bool &_val, bool *_status = NULL)
val(_val) { : FieldOption(_status), val(_val)
}; {
}
double numerical_value() const double numerical_value() const
{ {
return val; return val;
}; }
void numerical_value(double v) void numerical_value(double v)
{ {
modified(); modified();
val = v; val = v;
}; }
void get_text_representation(std::string & v_str) void get_text_representation(std::string & v_str)
{ {
std::ostringstream sstream; std::ostringstream sstream;
...@@ -187,14 +190,6 @@ FieldOptionBool(bool & _val, bool * _status = NULL):FieldOption(_status), ...@@ -187,14 +190,6 @@ FieldOptionBool(bool & _val, bool * _status = NULL):FieldOption(_status),
v_str = sstream.str(); v_str = sstream.str();
} }
}; };
class FieldOptionPath:public FieldOptionString
{
public:
FieldOptionType get_type()
{
return FIELD_OPTION_PATH;
};
};
void FieldManager::reset() void FieldManager::reset()
{ {
...@@ -252,6 +247,7 @@ int FieldManager::max_id() ...@@ -252,6 +247,7 @@ int FieldManager::max_id()
else else
return 0; return 0;
} }
void FieldManager::delete_field(int id) void FieldManager::delete_field(int id)
{ {
iterator it = find(id); iterator it = find(id);
...@@ -264,14 +260,14 @@ void FieldManager::delete_field(int id) ...@@ -264,14 +260,14 @@ void FieldManager::delete_field(int id)
} }
// StructuredField // StructuredField
class StructuredField:public Field class StructuredField : public Field{
{
double o[3], d[3]; double o[3], d[3];
int n[3]; int n[3];
double *data; double *data;
bool error_status; bool error_status;
std::string file_name; std::string file_name;
public:StructuredField() public:
StructuredField()
{ {
options["FileName"] = new FieldOptionString(file_name, &update_needed); options["FileName"] = new FieldOptionString(file_name, &update_needed);
data = NULL; data = NULL;
...@@ -280,9 +276,9 @@ public:StructuredField() ...@@ -280,9 +276,9 @@ public:StructuredField()
{ {
return "Structured"; return "Structured";
} }
virtual ~ StructuredField() { virtual ~StructuredField()
if(data) {
delete[]data; if(data) delete[]data;
} }
double operator() (double x, double y, double z) double operator() (double x, double y, double z)
{ {
...@@ -344,8 +340,7 @@ public:StructuredField() ...@@ -344,8 +340,7 @@ public:StructuredField()
} }
}; };
class LonLatField:public Field class LonLatField : public Field{
{
int field_id; int field_id;
public: public:
LonLatField() LonLatField()
...@@ -359,13 +354,8 @@ public: ...@@ -359,13 +354,8 @@ public:
} }
double operator() (double x, double y, double z) double operator() (double x, double y, double z)
{ {
return (*GModel::current()->getFields()->get(field_id)) (atan2(x, y), return (*GModel::current()->getFields()->get(field_id))
asin(z / (atan2(x, y), asin(z / sqrt(x * x + y * y + z * z)), 0);
sqrt(x * x +
y * y +
z *
z)),
0);
} }
FieldDialogBox *&dialog_box() FieldDialogBox *&dialog_box()
{ {
...@@ -374,8 +364,7 @@ public: ...@@ -374,8 +364,7 @@ public:
} }
}; };
class BoxField:public Field class BoxField : public Field {
{
double v_in, v_out, x_min, x_max, y_min, y_max, z_min, z_max; double v_in, v_out, x_min, x_max, y_min, y_max, z_min, z_max;
public: public:
BoxField() BoxField()
...@@ -406,9 +395,7 @@ public: ...@@ -406,9 +395,7 @@ public:
} }
}; };
class ThresholdField : public Field {
class ThresholdField:public Field
{
int iField; int iField;
double dmin, dmax, lcmin, lcmax; double dmin, dmax, lcmin, lcmax;
public: public:
...@@ -444,9 +431,7 @@ public: ...@@ -444,9 +431,7 @@ public:
} }
}; };
class GradientField : public Field {
class GradientField:public Field
{
int iField, kind; int iField, kind;
double delta; double delta;
public: public:
...@@ -499,8 +484,7 @@ public: ...@@ -499,8 +484,7 @@ public:
}; };
#if defined(HAVE_MATH_EVAL) #if defined(HAVE_MATH_EVAL)
class MathEvalExpression class MathEvalExpression {
{
bool error_status; bool error_status;
std::list < Field * >*list; std::list < Field * >*list;
int nvalues; int nvalues;
...@@ -588,8 +572,7 @@ public: ...@@ -588,8 +572,7 @@ public:
} }
}; };
class MathEvalField:public Field class MathEvalField : public Field {
{
MathEvalExpression expr; MathEvalExpression expr;
std::string f; std::string f;
public: public:
...@@ -617,8 +600,8 @@ public: ...@@ -617,8 +600,8 @@ public:
return "MathEval"; return "MathEval";
} }
}; };
class ParametricField:public Field
{ class ParametricField : public Field {
MathEvalExpression expr[3]; MathEvalExpression expr[3];
std::string f[3]; std::string f[3];
int ifield; int ifield;
...@@ -640,14 +623,9 @@ public: ...@@ -640,14 +623,9 @@ public:
} }
update_needed = false; update_needed = false;
} }
return (*GModel::current()->getFields()->get(ifield)) (expr[0]. return (*GModel::current()->getFields()->get(ifield))
evaluate(x, y, z), (expr[0].evaluate(x, y, z), expr[1].evaluate(x, y, z),
expr[1].evaluate(x, expr[2].evaluate(x, y, z));
y,
z),
expr[2].evaluate(x,
y,
z));
} }
FieldDialogBox *&dialog_box() FieldDialogBox *&dialog_box()
{ {
...@@ -661,8 +639,7 @@ public: ...@@ -661,8 +639,7 @@ public:
}; };
#endif #endif
class PostViewField:public Field class PostViewField : public Field {
{
OctreePost *octree; OctreePost *octree;
public:int view_index; public:int view_index;
double operator() (double x, double y, double z) double operator() (double x, double y, double z)
...@@ -670,8 +647,7 @@ public:int view_index; ...@@ -670,8 +647,7 @@ public:int view_index;
// FIXME: should test unique view num instead, but that would be slower // FIXME: should test unique view num instead, but that would be slower
if(view_index < 0 || view_index >= (int)PView::list.size()) if(view_index < 0 || view_index >= (int)PView::list.size())
return MAX_LC; return MAX_LC;
if(update_needed) if(update_needed){
{
if(octree) if(octree)
delete octree; delete octree;
octree = new OctreePost(PView::list[view_index]); octree = new OctreePost(PView::list[view_index]);
...@@ -702,18 +678,20 @@ public:int view_index; ...@@ -702,18 +678,20 @@ public:int view_index;
} }
*/ */
} }
//if(l <= 0) return MAX_LC; if(l <= 0) return MAX_LC;
return l; return l;
} }
const char *get_name() const char *get_name()
{ {
return "PostView"; return "PostView";
} }
PostViewField() { PostViewField()
{
octree = NULL; octree = NULL;
options["IView"] = new FieldOptionInt(view_index, &update_needed); options["IView"] = new FieldOptionInt(view_index, &update_needed);
} }
~PostViewField() { ~PostViewField()
{
if(octree) if(octree)
delete octree; delete octree;
} }
...@@ -724,8 +702,7 @@ public:int view_index; ...@@ -724,8 +702,7 @@ public:int view_index;
} }
}; };
class MinField:public Field class MinField : public Field {
{
std::list < int >idlist; std::list < int >idlist;
public: public:
MinField() MinField()
...@@ -754,8 +731,7 @@ public: ...@@ -754,8 +731,7 @@ public:
} }
}; };
class MaxField:public Field class MaxField : public Field {
{
std::list<int> idlist; std::list<int> idlist;
public: public:
MaxField() MaxField()
...@@ -785,8 +761,7 @@ public: ...@@ -785,8 +761,7 @@ public:
}; };
#ifdef HAVE_ANN #ifdef HAVE_ANN
class AttractorField:public Field class AttractorField : public Field {
{
ANNkd_tree *kdtree; ANNkd_tree *kdtree;
ANNpointArray zeronodes; ANNpointArray zeronodes;
ANNidxArray index; ANNidxArray index;
...@@ -794,7 +769,8 @@ class AttractorField:public Field ...@@ -794,7 +769,8 @@ class AttractorField:public Field
std::list < int >nodes_id; std::list < int >nodes_id;
std::list < int >edges_id; std::list < int >edges_id;
int n_nodes_by_edge; int n_nodes_by_edge;
public:AttractorField():kdtree(0), zeronodes(0) public:
AttractorField() : kdtree(0), zeronodes(0)
{ {
index = new ANNidx[1]; index = new ANNidx[1];
dist = new ANNdist[1]; dist = new ANNdist[1];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment