Ice Sheet System Model  4.18
Code documentation
Contours.h
Go to the documentation of this file.
1 
4 #ifndef _CONTAINER_CONTOURS_H_
5 #define _CONTAINER_CONTOURS_H_
6 
7 #include "../datastructures/datastructures.h"
8 #include "./Contour.h"
9 
10 class Contours: public DataSet{
11 
12  public:
13 
14  /*constructors, destructors*/
15  Contours();
16  ~Contours();
17 };
18 
19 /*Methods that relate to datasets: */
20 int ExpWrite(Contours* contours,char* domainname);
21 template <class doubletype> Contours* ExpRead(char* domainname){ /*{{{*/
22 
23  /*intermediary: */
24  int nprof;
25  int *profnvertices = NULL;
26  doubletype **pprofx = NULL;
27  doubletype **pprofy = NULL;
28 
29  /*If domainname is an empty string, return empty dataset*/
30  if (strcmp(domainname,"")==0){
31  nprof=0;
32  }
33  else{
34  ExpRead<doubletype>(&nprof,&profnvertices,&pprofx, &pprofy, NULL,domainname);
35  }
36 
37  /*now create dataset of contours: */
38  Contours *domain=new Contours();
39 
40  for(int i=0;i<nprof;i++){
41  domain->AddObject(new Contour<doubletype>(i,profnvertices[i],pprofx[i],pprofy[i],1));
42  }
43  return domain;
44 } /*}}}*/
45 
46 #endif //ifndef _CONTOURS_H_
DataSet::AddObject
int AddObject(Object *object)
Definition: DataSet.cpp:252
Contours
Declaration of Contours class.
Definition: Contours.h:10
Contours::Contours
Contours()
Definition: Contours.cpp:21
Contour
Definition: Contour.h:15
ExpWrite
int ExpWrite(Contours *contours, char *domainname)
Definition: Contours.cpp:32
Contours::~Contours
~Contours()
Definition: Contours.cpp:26
Contour.h
: header file for Contour object
DataSet
Declaration of DataSet class.
Definition: DataSet.h:14
ExpRead
Contours * ExpRead(char *domainname)
Definition: Contours.h:21