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

added some comments

parent f40fd316
No related branches found
No related tags found
No related merge requests found
// $Id: PViewData.cpp,v 1.18 2008-04-22 07:37:16 geuzaine Exp $
// $Id: PViewData.cpp,v 1.19 2008-04-22 09:29:29 geuzaine Exp $
//
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
//
......@@ -40,7 +40,7 @@ PViewData::~PViewData()
bool PViewData::finalize()
{
if(!_adaptive && _interpolation.size()){
Msg(INFO, "Initializing adaptive data %p interp size= %d",
Msg(INFO, "Initializing adaptive data %p interp size=%d",
this, _interpolation.size());
_adaptive = new adaptiveData(this);
_adaptive->initWithLowResolution(0);
......
......@@ -101,10 +101,11 @@ class PViewData {
// Returns the number of values available for the ele-th element
// in the ent-th entity
virtual int getNumValues(int step, int ent, int ele) = 0;
// Gets the idx'th value for the ele-th element in the ent-th entity
virtual void getValue(int step, int ent, int ele, int idx, double &val) = 0;
// Gets/sets the comp-th component (at the step-th time step)
// associated with the node-th node from the ele-th element in the
// ent-th entity
virtual void getValue(int step, int ent, int ele, int idx, double &val) = 0;
virtual void getValue(int step, int ent, int ele, int nod, int comp, double &val) = 0;
virtual void setValue(int step, int ent, int ele, int nod, int comp, double val);
// Returns a scalar value (same as value for scalars, norm for
......@@ -114,32 +115,47 @@ class PViewData {
// Returns the number of edges of the ele-th element in the ent-th
// entity
virtual int getNumEdges(int step, int ent, int ele) = 0;
// Returns the number of 2D/3D strings in the view
virtual int getNumStrings2D(){ return 0; }
virtual int getNumStrings3D(){ return 0; }
// Returns the i-th 2D/3D string in the view
virtual void getString2D(int i, int step, std::string &str,
double &x, double &y, double &style){}
virtual void getString3D(int i, int step, std::string &str,
double &x, double &y, double &z, double &style){}
// Change the orientation of the ele-th element
virtual void revertElement(int step, int ent, int ele){}
// Cheks if the view is empty
virtual bool empty();
virtual void smooth(){}
virtual bool combineTime(nameData &nd){ return false; }
virtual bool combineSpace(nameData &nd){ return false; }
// Cheks if we should skip the ent-th entity
virtual bool skipEntity(int step, int ent){ return false; }
// Cheks if we should skip the ele-th entity
virtual bool skipElement(int step, int ent, int ele,
bool checkVisibility=false){ return false; }
virtual bool hasTimeStep(int step){ return step < getNumTimeSteps(); }
virtual bool hasPartition(int part){ return false; }
virtual bool hasMultipleMeshes(){ return false; }
virtual bool hasModel(GModel *model, int step=-1){ return false; }
virtual bool useGaussPoints(){ return false; }
// check if the view is adaptive
bool isAdaptive(){ return _adaptive ? true : false; }
// return the adaptive data
adaptiveData *getAdaptiveData(){ return _adaptive; }
// set/get the interpolation matrices for elements with "type"
// number of edges
void setInterpolationScheme(int type, List_T *coef, List_T *pol,
List_T *coefGeo=0, List_T *polGeo=0);
int getInterpolationScheme(int type, std::vector<List_T*> &p);
// Smoothes the data in the view (makes it C0)
virtual void smooth(){}
virtual bool combineTime(nameData &nd){ return false; }
virtual bool combineSpace(nameData &nd){ return false; }
// I/O routines
virtual bool writeSTL(std::string fileName);
virtual bool writeTXT(std::string fileName);
......
......@@ -897,9 +897,10 @@ void adaptiveElements<T>::initWithLowResolution(PViewData *data, int step)
template <class T>
void adaptiveElements<T>::changeResolution(int level, double tol, GMSH_Post_Plugin *plug)
{
if(!_val) return; // error
//if(level == _resolutionLevel && tol == _tolerance && !plug) return;
if(!_val){
Msg(GERROR, "Trying to change resolution in wrong state");
return;
}
_resolutionLevel = level;
_tolerance = tol;
......@@ -1026,11 +1027,10 @@ int adaptiveElements<T>::_zoomElement(int ielem, int level, GMSH_Post_Plugin *pl
return 0;
}
adaptivePoint **p;
for(typename std::list<T*>::iterator it = T::all.begin();
it != T::all.end(); it++){
if((*it)->visible){
p = (*it)->p;
adaptivePoint **p = (*it)->p;
for(int k = 0; k < T::numNodes; ++k) List_Add(_listEle, &p[k]->X);
for(int k = 0; k < T::numNodes; ++k) List_Add(_listEle, &p[k]->Y);
for(int k = 0; k < T::numNodes; ++k) List_Add(_listEle, &p[k]->Z);
......
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