~ubuntu-branches/ubuntu/vivid/gyoto/vivid

« back to all changes in this revision

Viewing changes to lib/ComplexAstrobj.C

  • Committer: Package Import Robot
  • Author(s): Thibaut Paumard
  • Date: 2014-10-21 14:21:10 UTC
  • mfrom: (8.2.4 sid)
  • Revision ID: package-import@ubuntu.com-20141021142110-1u2odjj2r0hvdh5g
Tags: 0.2.3-1
* New upstream release
* Move to debian-astro team

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
      elements_[i] = o[i]->clone();
48
48
    }
49
49
  }
50
 
  setMetric(gg_); // to set the same metric in all elements
 
50
  metric(gg_); // to set the same metric in all elements
51
51
}
52
52
Complex *Complex::clone() const {return new Complex(*this); }
53
53
 
57
57
  if (cardinal_) for (size_t i=0; i< cardinal_; ++i) elements_[i] = NULL;
58
58
}
59
59
 
60
 
void Complex::setMetric(SmartPointer<Metric::Generic> gg)
 
60
void Complex::metric(SmartPointer<Metric::Generic> gg)
61
61
{
62
 
  Generic::setMetric(gg);
 
62
  Generic::metric(gg);
63
63
  for (size_t i=0; i<cardinal_; ++i) {
64
64
    if (debug()) {
65
 
      cerr << "DEBUG: Complex::setMetric(gg): ";
 
65
      cerr << "DEBUG: Complex::metric(gg): ";
66
66
      cerr << "elements_["<<i<<"] is a ";
67
 
      cerr << elements_[i]->getKind();
 
67
      cerr << elements_[i]->kind();
68
68
      cerr << ". Setting metric." << endl;
69
69
    }
70
 
    elements_[i]->setMetric(gg_);
 
70
    elements_[i]->metric(gg_);
71
71
  }
72
72
}
73
73
 
85
85
  delete [] orig; orig = NULL;
86
86
  elements_[cardinal_] = e;
87
87
  ++cardinal_;
88
 
  if (gg_) e->setMetric(gg_);
89
 
  else gg_ = e->getMetric();
 
88
  if (gg_) e->metric(gg_);
 
89
  else gg_ = e->metric();
90
90
  if (debug())
91
91
    cerr << "DEBUG: out Complex::append(SmartPointer<Generic> e)" << endl;
92
92
}
121
121
 
122
122
size_t Complex::getCardinal() const {return cardinal_; }
123
123
 
 
124
double Complex::deltaMax(double coord[8]) {
 
125
  double h1max=DBL_MAX, tmp;
 
126
  for (size_t i=0; i<cardinal_; ++i)
 
127
    if (h1max> (tmp=elements_[i]->deltaMax(coord))) h1max=tmp;
 
128
  return h1max;
 
129
}
 
130
 
124
131
int Complex::Impact(Photon* ph, size_t index, Properties *data)
125
132
{
126
133
  int res=0, *impact = new int[cardinal_];
149
156
        if (impact[i]) {
150
157
          if (debug())
151
158
            cerr << "DEBUG: Complex::Impact(...): calling Impact for elements_["
152
 
                 << i << "] (" << elements_[i]->getKind() << ")" << endl;
 
159
                 << i << "] (" << elements_[i]->kind() << ")" << endl;
153
160
          elements_[i]->Impact(&refine, n, data);
154
161
        }
155
162
    }
163
170
void Complex::fillElement(FactoryMessenger *fmp) const {
164
171
  FactoryMessenger * childfmp=NULL;
165
172
 
166
 
  fmp -> setMetric (getMetric()) ;
 
173
  fmp -> metric (metric()) ;
167
174
 
168
175
  for (size_t i=0; i<cardinal_; ++i) {
169
176
    childfmp = fmp -> makeChild ( "SubAstrobj" );
181
188
  string name="", content="", unit="";
182
189
  FactoryMessenger * child = NULL;
183
190
 
184
 
  setMetric( fmp->getMetric() );
 
191
  metric( fmp->metric() );
185
192
 
186
193
  while (fmp->getNextParameter(&name, &content, &unit)) {
187
194
    if (debug())