Points&Forces (survey)
Software tools facilitating the task of surveying architecture
a_element.cxx
Go to the documentation of this file.
1 /*
2  Copyright 2009-2019 Pierre SMARS (smars@yuntech.edu.tw)
3  This program is free software: you can redistribute it and/or modify
4  it under the terms of the GNU General Public License as published by
5  the Free Software Foundation, either version 2 of the License, or
6  (at your option) any later version.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16 #include "a_element.h"
17 
18 #include "vtkCellArray.h"
19 #include "vtkDataSetMapper.h"
20 #include "vtkElevationFilter.h"
21 #include "vtkLookupTable.h"
22 #include "vtkMatrix4x4.h"
23 #include "vtkPoints.h"
24 #include "vtkPointData.h"
25 //#include "vtkPolyDataMapper.h"
26 #include "vtkPolyDataNormals.h"
27 #include "vtkProperty.h"
28 
29 std::ostringstream log_;
30 
31 //---------------------------------------------------------------------------
33 {
34  name_ = "noname";
35  R_ = G_ = B_ = 1;
36  thickness_ = 1;
37  can_ = 0;
38  image_ = 0;
39  small_ = 1.e-6;
40  polydata_ = vtkPolyData::New();
41  polydata_->Allocate(100,100);
42  vtkLookupTable * lut = vtkLookupTable::New();
43  lut->SetHueRange(0.6,0);
44  lut->SetSaturationRange(1,1);
45  lut->SetValueRange(1,1);
46  // vtkPolyDataMapper * map = vtkPolyDataMapper::New();
47  vtkDataSetMapper * map = vtkDataSetMapper::New();
48  map->SetInputData(polydata_);
49  map->SetScalarRange(0.,1.);
50 // vtk8? map->ImmediateModeRenderingOn();
51  // map->InterpolateScalarsBeforeMappingOn(); (not there, no possibility to give colours to elements)
52  map->SetLookupTable(lut);
53  lut->Delete();
54  vtkMapper::SetResolveCoincidentTopologyToPolygonOffset();
55  actor_ = vtkActor::New();
56  actor_->SetMapper(map);
57  actor_->GetProperty()->SetColor(1,1,1);
58  actor_->GetProperty()->SetPointSize(1);
59  // actor_->GetProperty()->BackfaceCullingOff();
60  actor_->DragableOff();
61  // actor_->DragableOn();
62  empty_ = true;
63 }
64 
65 //---------------------------------------------------------------------------
66 const std::string a_element::help()
67 {
68  std::ostringstream o;
69  o << "*********" << std::endl;
70  o << "a_element" << std::endl;
71  o << "*********" << std::endl;
72  o << "This is a graphical element class meant to be included in a_canvas object" << std::endl;
73  o << "Commands:" << std::endl;
74  o << "--------" << std::endl;
75  o << "name: set/get the name of the object" << std::endl;
76  o << "empty: check whether it contains data" << std::endl;
77  o << "color 'R' 'G' 'B': set the color [default: 1 1 1]" << std::endl;
78  o << "R: set/get the red value [0-1]" << std::endl;
79  o << "G: set/get the green value [0-1]" << std::endl;
80  o << "B: set/get the blue value [0-1]" << std::endl;
81  o << "thickness: set/get thickness of lines or points in pixel [default: 1]" << std::endl;
82  o << "opacity: set/get opacity of element" << std::endl;
83  o << "edges: show or hide the edges" << std::endl;
84  o << "smooth: smooth rendering" << std::endl;
85  o << "place 'x' 'y' 'z': position the origin of the object at the given point (absolute)" << std::endl;
86  o << "translate 'x' 'y' 'z': translate the object (relative)" << std::endl;
87  o << "open 'file': read a file containing appropriate data for the container" << std::endl;
88  o << "save 'file': save the data to a file" << std::endl;
89  o << "save_transform 'file': save the transform matrix [4x4] to a file" << std::endl;
90  o << "scale: set/get the scale (set the origin before scaling)" << std::endl;
91  o << "scale 'sx' 'sy' 'sz': scaled each dimension indenpendently" << std::endl;
92  o << "orient 'roll' (x) 'pitch' (y) 'yaw' (z): orient the element [in degree] (set the origin before)" << std::endl;
93  o << "orient: get the orientation" << std::endl;
94  o << "origin: set/get origin" << std::endl;
95  o << "small: set/get a number considered small [default: ]" << std::endl;
96  o << "center: get the center of gravity" << std::endl;
97  o << "size: get a representative size" << std::endl;
98  o << "bounds: get the bounds of the element" << std::endl;
99  o << "minx, maxx, miny, maxy, minz, maxz: get details about the bounds" << std::endl;
100  o << "relief x1 y1 z1 x2 y2 z2: color the element in between two points according to distance" << std::endl;
101  o << "steps: number of colored bands to use" << std::endl;
102  o << "open_scalars 'file': color elements using a scalar file" << std::endl;
103  o << "image 'a_image': associate a texture to project on the object" << std::endl;
104  o << "imageon: show the image" << std::endl;
105  o << "imageoff: hide the image" << std::endl;
106  return o.str();
107 }
108 //---------------------------------------------------------------------------
110 {
111  log_.str("");
112  log_ << this->type() << " $" << name_ << std::endl;
113  this->log(log_);
114 }
115 //---------------------------------------------------------------------------
117 {
118  this->clear();
119 }
120 //---------------------------------------------------------------------------
122 {
123  polydata_->Delete();
124  actor_->Delete();
125 }
126 //---------------------------------------------------------------------------
128 {
129  if (can_ != 0) can_->render();
130 }
131 //---------------------------------------------------------------------------
133 {
134  if (can_ != 0)
135  {
136  for (int i=0;i<log0_.size(); i++)
137  {
138  std::string l = log0_[i];
139  int pos = l.find("noname");
140  if (pos != std::string::npos)
141  l.replace(pos,6,name_);
142  std::string st = l.substr(0,3);
143  if (st=="a_")
144  {
145  can_->logfile() << "set " << name_ << " [" << this->type() << "]" << std::endl;
146  can_->logfile() << "$" << name_ << " name " << name_ << std::endl;
147  }
148  else
149  can_->logfile() << l << std::endl;
150  }
151  log0_.clear();
152  }
153 }
154 //---------------------------------------------------------------------------
155 void a_element::log(std::ostringstream& text)
156 {
157  if (can_ != 0)
158  can_->logfile() << text.str() << std::endl;
159  else
160  {
161  std::string l = text.str();
162  std::string line = l.replace(l.find('\n'),1,"");
163  log0_.push_back(line);
164  }
165  text.str("");
166 }
167 //---------------------------------------------------------------------------
169 {
170  actor_->SetPosition(0.,0.,0.);
171  actor_->SetOrientation(0.,0.,0.);
172  actor_->SetScale(1.,1.,1.);
173  polydata_->Modified();
174  // actor_->GetProperty()->SetColor(1,1,1);
175  // actor_->GetProperty()->SetPointSize(1.);
176  // actor_->GetProperty()->SetLineWidth(1.);
177  this->render();
178 }
179 //---------------------------------------------------------------------------
180 void a_element::color(double r, double g, double b)
181 {
182  if ((r>=0)&&(g>=0)&&(b>=0)&&(r<=1)&&(g<=1)&&(b<=1))
183  {
184  //not working if scalars where used before
185  // actor_->GetMapper()->InterpolateScalarsBeforeMappingOff(); // not sufficient
186  actor_->GetProperty()->SetColor(r,g,b);
187  R_ = r; G_ = g; B_ = b;
188  log_ << "$" << name_ << " color " << r << " " << g << " " << b << std::endl;
189  this->log(log_);
190  this->render();
191  }
192 }
193 //---------------------------------------------------------------------------
194 void a_element::R(double v)
195 {
196  if ((v>=0)&&(v<=1))
197  {
198  actor_->GetProperty()->SetColor(v,G_,B_);
199  R_ = v;
200  log_ << "$" << name_ << " R " << v << std::endl;
201  this->render();
202  }
203 }
204 //---------------------------------------------------------------------------
205 void a_element::G(double v)
206 {
207  if ((v>=0)&&(v<=1))
208  {
209  actor_->GetProperty()->SetColor(R_,v,B_);
210  G_ = v;
211  log_ << "$" << name_ << " G " << v << std::endl;
212  this->render();
213  }
214 }
215 //---------------------------------------------------------------------------
216 void a_element::B(double v)
217 {
218  if ((v>=0)&&(v<=1))
219  {
220  actor_->GetProperty()->SetColor(R_,G_,v);
221  B_ = v;
222  log_ << "$" << name_ << " B " << v << std::endl;
223  this->render();
224  }
225 }
226 //---------------------------------------------------------------------------
227 void a_element::thickness(const int v)
228 {
229  if (v>0)
230  {
231  actor_->GetProperty()->SetPointSize(v);
232  actor_->GetProperty()->SetLineWidth(v);
233  thickness_ = v;
234  this->render();
235  log_ << "$" << name_ << " thickness " << v << std::endl;
236  this->log(log_);
237  }
238 }
239 //---------------------------------------------------------------------------
241 {
242  vtkLookupTable * lut = (vtkLookupTable *)actor_->GetMapper()->GetLookupTable();
243  if (on)
244  {
245  unsigned int number_steps = lut->GetNumberOfTableValues();
246  for (short i=0; i<number_steps; i++)
247  lut->SetTableValue(i,i%2,i%2,i%2);
248  this->render();
249  }
250  else
251  {
252  lut->ForceBuild();
253  this->greyscale(1);
254  }
255 }
256 //---------------------------------------------------------------------------
258 {
259  vtkLookupTable * lut = (vtkLookupTable *)actor_->GetMapper()->GetLookupTable();
260  if (g)
261  {
262  lut->SetHueRange(0,0);
263  lut->SetSaturationRange(0,0);
264  lut->SetValueRange(0,1);
265  } else
266  {
267  lut->SetHueRange(0.6,0);
268  lut->SetSaturationRange(1,1);
269  lut->SetValueRange(1,1);
270  }
271  this->render();
272 }
273 //---------------------------------------------------------------------------
275 {
276  vtkLookupTable * lut = (vtkLookupTable *)actor_->GetMapper()->GetLookupTable();
277  double a = lut->GetHueRange()[0];
278  if (a==0)
279  return true;
280  return false;
281 }
282 //---------------------------------------------------------------------------
283 void a_element::steps(const int st)
284 {
285  if ((st<0)||(st>255))
286  return;
287  vtkLookupTable * lut = (vtkLookupTable *)actor_->GetMapper()->GetLookupTable();
288  lut->SetNumberOfTableValues(st);
289  this->render();
290  log_ << "$" << name_ << " steps " << st << std::endl;
291  this->log(log_);
292 }
293 //---------------------------------------------------------------------------
294 int a_element::steps() const
295 {
296  vtkLookupTable * lut = (vtkLookupTable *)actor_->GetMapper()->GetLookupTable();
297  return lut->GetNumberOfTableValues();
298 }
299 //---------------------------------------------------------------------------
300 void a_element::opacity(const double val)
301 {
302  if ((val<0)||(val>1))
303  return;
304  actor_->GetProperty()->SetOpacity(val);
305  // actor_->GetBackfaceProperty()->SetOpacity(val);
306  this->render();
307  log_ << "$" << name_ << " opacity " << val << std::endl;
308  this->log(log_);
309 }
310 //---------------------------------------------------------------------------
311 void a_element::edges(const bool val)
312 {
313  if (val)
314  {
315  actor_->GetProperty()->EdgeVisibilityOn();
316  actor_->GetProperty()->SetEdgeColor(1,1,0);
317  }
318  else
319  actor_->GetProperty()->EdgeVisibilityOff();
320  this->render();
321  log_ << "$" << name_ << " edges " << val << std::endl;
322  this->log(log_);
323 }
324 //---------------------------------------------------------------------------
325 void a_element::smooth(const bool val)
326 {
327  vtkDataSetMapper * map = (vtkDataSetMapper *)(actor_->GetMapper());
328  if (val)
329  {
330  vtkPolyDataNormals * normals = vtkPolyDataNormals::New();
331  normals->SetInputData(polydata_);
332  normals->SetFeatureAngle(20);
333  map->SetInputConnection(normals->GetOutputPort());
334  normals->Delete();
335  }
336  else
337  map->SetInputData(polydata_);
338  this->render();
339  log_ << "$" << name_ << " smooth " << val << std::endl;
340  this->log(log_);
341 }
342 //---------------------------------------------------------------------------
343 void a_element::relief(const a_point & p1, const a_point & p2)
344 {
345  actor_->GetMapper()->InterpolateScalarsBeforeMappingOn();
346  vtkElevationFilter * elevation = vtkElevationFilter::New();
347  elevation->SetInputData(polydata_);
348  elevation->SetLowPoint(p1.x(),p1.y(),p1.z());
349  elevation->SetHighPoint(p2.x(),p2.y(),p2.z());
350  elevation->SetScalarRange(0.,1.);
351  vtkDataSetMapper * map = (vtkDataSetMapper *)(actor_->GetMapper());
352  map->SetInputConnection(elevation->GetOutputPort());
353  elevation->Delete();
354  this->render();
355  log_ << "$" << name_ << " relief ";
356  log_ << p1.x() << " " << p1.y() << " " << p1.z() << " ";
357  log_ << p2.x() << " " << p2.y() << " " << p2.z() << " " << std::endl;
358  this->log(log_);
359 }
360 //---------------------------------------------------------------------------
361 void a_element::dxfout(std::ostream& o) const
362 {
363 }
364 //---------------------------------------------------------------------------
366 {
367  actor_->SetTexture(image.texture());
368  vtkFloatArray * tcoords = vtkFloatArray::New();
369  tcoords->SetNumberOfComponents(2);
370  image.gettcoords(polydata_->GetPoints(),tcoords);
371  polydata_->GetPointData()->SetTCoords(tcoords);
372  tcoords->Delete();
373  this->render();
374  image_ = &image;
375  log_ << "$" << name_ << " image " << image.name() << std::endl;
376  this->log(log_);
377 }
378 //---------------------------------------------------------------------------
380 {
381  if (image_ != 0)
382  {
383  actor_->SetTexture(image_->texture());
384  this->render();
385  }
386  log_ << "$" << name_ << " image on" << std::endl;
387  this->log(log_);
388 }
389 //---------------------------------------------------------------------------
391 {
392  actor_->SetTexture(0);
393  this->render();
394  log_ << "$" << name_ << " image off" << std::endl;
395  this->log(log_);
396 }
397 //***********************************************************
398 //-operator>>----------------------------------------------------------------
399 std::istream& operator>> (std::istream& i, a_element& l)
400 {
401  l.read(i);
402  return i;
403 }
404 //-operator<<----------------------------------------------------------------
405 std::ostream& operator<< (std::ostream& o, const a_element& l)
406 {
407  l.write(o);
408  return o;
409 }
410 //---------------------------------------------------------------------------
411 void a_element::open(const std::string& file)
412 {
413  std::ifstream ff(file.c_str());
414  if (ff) this->read(ff);
415  ff.close();
416  log_ << "$" << name_ << " open " << file << std::endl;
417  this->log(log_);
418 }
419 //---------------------------------------------------------------------------
420 void a_element::save(const std::string& file)
421 {
422  std::ofstream ff(file.c_str());
423  if (ff) this->write(ff);
424  ff.close();
425  log_ << "$" << name_ << " save " << file << std::endl;
426  this->log(log_);
427 }
428 //---------------------------------------------------------------------------
429 void a_element::save_transform(const std::string& file)
430 {
431  std::ofstream ff(file.c_str());
432  vtkMatrix4x4 * mat = actor_->GetMatrix();
433  /* vtkMatrix4x4 * tr = vtkMatrix4x4::New();
434  vtkMatrix4x4 * itr = vtkMatrix4x4::New();
435  vtkMatrix4x4 * mat2 = vtkMatrix4x4::New();
436  vtkMatrix4x4 * mat3 = vtkMatrix4x4::New();
437  tr->Identity();
438  itr->Identity();
439  double x[3];
440  actor_->GetOrigin(x);
441  tr->SetElement(0,3,x[0]);
442  tr->SetElement(1,3,x[1]);
443  tr->SetElement(2,3,x[2]);
444  itr->SetElement(0,3,-x[0]);
445  itr->SetElement(1,3,-x[1]);
446  itr->SetElement(2,3,-x[2]);
447  vtkMatrix4x4::Multiply4x4(mat,tr,mat2);
448  vtkMatrix4x4::Multiply4x4(itr,mat2,mat3);
449  */
450  ff << "4 4" << std::endl;
451  for (int i=0; i<4; i++)
452  ff << mat->GetElement(i,0) << " " << mat->GetElement(i,1) << " " << mat->GetElement(i,2) << " " << mat->GetElement(i,3) << " " << std::endl;
453  ff.close();
454  log_ << "$" << name_ << " save_transform " << file << std::endl;
455  this->log(log_);
456 }
457 //---------------------------------------------------------------------------
458 void a_element::open_scalars(const std::string& file)
459 {
460  std::ifstream in(file.c_str());
461  if (in)
462  {
463  vtkDoubleArray * scalars = vtkDoubleArray::New();
464  scalars->SetNumberOfComponents(1);
465  int npts;
466  in >> npts;
467  for (int i=0; i<npts; i++)
468  {
469  double val;
470  in >> val;
471  scalars->InsertNextValue(val);
472  }
473  //log_ << npts << std::endl;
474  in.close();
475  actor_->GetMapper()->InterpolateScalarsBeforeMappingOn();
476  polydata_->GetPointData()->SetScalars(scalars);
477  actor_->GetProperty()->SetInterpolationToFlat();
478  this->render();
479  log_ << "$" << name_ << " open_scalars " << file << std::endl;
480  this->log(log_);
481  }
482 }
483 //---------------------------------------------------------------------------
485 {
486  double b[6];
487  polydata_->Modified();
488  actor_->GetMapper()->Update();
489  actor_->GetMapper()->GetBounds(b);
490  polydata_->ComputeBounds();
491  polydata_->GetBounds(b);
492  std::cout << name_ << ": ";
493  for (int k=0; k<6; k++) std::cout << b[k] << " ";
494  std::cout << std::endl;
495  this->render();
496 }
497 //---------------------------------------------------------------------------
498 void a_element::place(const double x, const double y, const double z)
499 {
500  actor_->SetPosition(x,y,z);
501  this->render();
502  log_ << "$" << name_ << " place " << x << " " << y << " " << z << std::endl;
503  this->log(log_);
504 }
505 //---------------------------------------------------------------------------
506 void a_element::translate(const double dx, const double dy, const double dz)
507 {
508  double x[3];
509  actor_->GetPosition(x);
510  actor_->SetPosition(x[0]+dx,x[1]+dy,x[2]+dz);
511  this->render();
512  log_ << "$" << name_ << " translate " << dx << " " << dy << " " << dz << std::endl;
513  this->log(log_);
514 }
515 //---------------------------------------------------------------------------
516 void a_element::origin(const double x, const double y, const double z)
517 {
518  actor_->SetOrigin(x,y,z);
519  this->render();
520  log_ << "$" << name_ << " origin " << x << " " << y << " " << z << std::endl;
521  this->log(log_);
522 }
523 //---------------------------------------------------------------------------
524 void a_element::orient(const double x, const double y, const double z)
525 {
526  // Orientation is specified as X,Y and Z rotations in that order, but they are performed as RotateZ, RotateX, and finally RotateY.
527  actor_->SetOrientation(x,y,z);
528  this->render();
529  log_ << "$" << name_ << " orient " << x << " " << y << " " << z << std::endl;
530  this->log(log_);
531 }
532 //---------------------------------------------------------------------------
533 void a_element::rotate(const double dx, const double dy, const double dz)
534 {
535  actor_->AddOrientation(dx,dy,dz);
536  this->render();
537  log_ << "$" << name_ << " rotate " << dx << " " << dy << " " << dz << std::endl;
538  this->log(log_);
539 }
540 //---------------------------------------------------------------------------
541 void a_element::scale(const double s)
542 {
543  actor_->SetScale(s,s,s);
544  this->render();
545  log_ << "$" << name_ << " scale " << s << std::endl;
546  this->log(log_);
547 }
548 //---------------------------------------------------------------------------
549 void a_element::scale(const double s1, const double s2, const double s3)
550 {
551  actor_->SetScale(s1,s2,s3);
552  this->render();
553  log_ << "$" << name_ << " scale " << s1 << " " << s2 << " " << s3 << std::endl;
554  this->log(log_);
555 }
556 //---------------------------------------------------------------------------
557 a_point a_element::place() const
558 {
559  double x[3];
560  actor_->GetPosition(x);
561  return a_point(x);
562 }
563 //---------------------------------------------------------------------------
564 a_point a_element::origin() const
565 {
566  double x[3];
567  actor_->GetOrigin(x);
568  return a_point(x);
569 }
570 //---------------------------------------------------------------------------
571 a_point a_element::orient() const
572 {
573  double x[3];
574  actor_->GetOrientation(x);
575  return a_point(x);
576 }
577 //---------------------------------------------------------------------------
578 double a_element::scale() const
579 {
580  double x[3];
581  actor_->GetScale(x);
582  return x[0];
583 }
584 //---------------------------------------------------------------------------
585 a_point a_element::center() const
586 {
587  double b[6];
588  actor_->GetBounds(b);
589  return a_point((b[0]+b[1])/2.,(b[2]+b[3])/2.,(b[4]+b[5])/2.);
590 }
591 //---------------------------------------------------------------------------
592 double a_element::size() const
593 {
594  double b[6];
595  actor_->GetBounds(b);
596  a_point p1(b[0],b[2],b[4]);
597  a_point p2(b[1],b[3],b[5]);
598  return (p2-p1).norm();
599 }
600 //---------------------------------------------------------------------------
601 double a_element::minx() const
602 {
603  double b[6];
604  actor_->GetBounds(b);
605  return b[0];
606 }
607 //---------------------------------------------------------------------------
608 double a_element::maxx() const
609 {
610  double b[6];
611  actor_->GetBounds(b);
612  return b[1];
613 }
614 //---------------------------------------------------------------------------
615 double a_element::miny() const
616 {
617  double b[6];
618  actor_->GetBounds(b);
619  return b[2];
620 }
621 //---------------------------------------------------------------------------
622 double a_element::maxy() const
623 {
624  double b[6];
625  actor_->GetBounds(b);
626  return b[3];
627 }
628 //---------------------------------------------------------------------------
629 double a_element::minz() const
630 {
631  double b[6];
632  actor_->GetBounds(b);
633  return b[4];
634 }
635 //---------------------------------------------------------------------------
636 double a_element::maxz() const
637 {
638  double b[6];
639  actor_->GetBounds(b);
640  return b[5];
641 }
642 //---------------------------------------------------------------------------
643 int a_element::addpoint(const a_point& p)
644 {
645  vtkMatrix4x4 * mat = actor_->GetMatrix();
646  vtkPoints * points = polydata_->GetPoints();
647  int n_pts = points->GetNumberOfPoints();
648  for (int k = 0; k < n_pts; k++)
649  {
650  double x[4];
651  x[3] = 1.;
652  points->GetPoint(k,x);
653  mat->MultiplyPoint(x,x);
654  a_point pn(x[0],x[1],x[2]);
655  if ((pn-p).norm() < small_)
656  return k;
657  }
658  double x[] = {p.x(), p.y(), p.z()};
659  points->InsertNextPoint(x);
660  return n_pts;
661 }
662 //---------------------------------------------------------------------------
663 void d_v(a_element * la) {delete la;}
664 //---------------------------------------------------------------------------
665 void delete_vector(std::vector<a_element *> & v)
666 {
667  std::for_each(v.begin(),v.end(),d_v);
668  v.clear();
669 }
std::ostream & operator<<(std::ostream &o, const a_element &l)
Definition: a_element.cxx:405
std::ostringstream log_
Definition: a_element.cxx:29
std::istream & operator>>(std::istream &i, a_element &l)
Definition: a_element.cxx:399
void delete_vector(std::vector< a_element * > &v)
Definition: a_element.cxx:665
void d_v(a_element *la)
Definition: a_element.cxx:663
void logfile(a_text &text)
Definition: a_canvas.cxx:245
void render()
Definition: a_canvas.h:130
layer used by screen to draw vector graphics
Definition: a_element.h:39
void open(const std::string &file)
Definition: a_element.cxx:411
vtkPolyData * polydata_
Definition: a_element.h:125
a_image * image_
Definition: a_element.h:127
double maxy() const
Definition: a_element.cxx:622
void log(std::ostringstream &text)
Definition: a_element.cxx:155
void logname()
Definition: a_element.cxx:109
virtual void clear()
Definition: a_element.cxx:121
void open_scalars(const std::string &file)
Definition: a_element.cxx:458
void smooth(const bool val)
Definition: a_element.cxx:325
a_point origin() const
Definition: a_element.cxx:564
virtual void read(std::istream &in)
Definition: a_element.h:89
int addpoint(const a_point &p)
Definition: a_element.cxx:643
void dxfout(std::ostream &o) const
Definition: a_element.cxx:361
static const std::string help()
Definition: a_element.cxx:66
void translate(const double x, const double y, const double z)
Definition: a_element.cxx:506
void image(a_image &image)
Definition: a_element.cxx:365
void save(const std::string &file)
Definition: a_element.cxx:420
a_point place() const
Definition: a_element.cxx:557
double miny() const
Definition: a_element.cxx:615
double scale() const
Definition: a_element.cxx:578
void reset_mapper_clipping()
Definition: a_element.cxx:484
double small_
Definition: a_element.h:135
bool empty_
Definition: a_element.h:132
void save_transform(const std::string &file)
Definition: a_element.cxx:429
std::vector< std::string > log0_
Definition: a_element.h:133
double minz() const
Definition: a_element.cxx:629
void relief(const a_point &p1, const a_point &p2)
Definition: a_element.cxx:343
std::string name_
Definition: a_element.h:123
double maxx() const
Definition: a_element.cxx:608
void reset()
Definition: a_element.cxx:168
double R() const
Definition: a_element.h:58
double maxz() const
Definition: a_element.cxx:636
void imageoff()
Definition: a_element.cxx:390
double size() const
Definition: a_element.cxx:592
double B_
Definition: a_element.h:130
void zebra(bool)
Definition: a_element.cxx:240
double G() const
Definition: a_element.h:59
void imageon()
Definition: a_element.cxx:379
double minx() const
Definition: a_element.cxx:601
bool greyscale() const
get the scalar viewing mode
Definition: a_element.cxx:274
void color(double r, double g, double b)
Definition: a_element.cxx:180
int thickness_
Definition: a_element.h:131
double R_
Definition: a_element.h:128
vtkActor * actor_
Definition: a_element.h:124
void flushlog()
Definition: a_element.cxx:132
a_canvas * can_
Definition: a_element.h:126
void opacity(const double val)
Definition: a_element.cxx:300
a_point center() const
Definition: a_element.cxx:585
double G_
Definition: a_element.h:129
virtual std::string type() const
Definition: a_element.h:44
void rotate(const double pitch, const double roll, const double yaw)
Definition: a_element.cxx:533
a_point orient() const
Definition: a_element.cxx:571
int steps() const
Definition: a_element.cxx:294
void render()
Definition: a_element.cxx:127
int thickness() const
Definition: a_element.h:69
double B() const
Definition: a_element.h:60
virtual void write(std::ostream &o) const
Definition: a_element.h:90
void edges(const bool val)
Definition: a_element.cxx:311
vtkTexture * texture() const
Definition: a_image.h:39
void name(std::string aname)
Definition: a_image.h:43
double v(const uint32_t step, const uint32_t n)
Definition: generate.cxx:42
std::streambuf * on
Definition: ply2tri.cxx:36
std::istringstream in
Definition: ply2tri.cxx:32