Points&Forces (survey)
Software tools facilitating the task of surveying architecture
a_axes.cxx
Go to the documentation of this file.
1 /*
2  Copyright 2002-2016 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_axes.h"
17 #include "vtkAxes.h"
18 #include "vtkPoints.h"
19 #include "vtkPolyDataMapper.h"
20 #include "vtkProperty.h"
21 #include "vtkLookupTable.h"
22 //---------------------------------------------------------------------------
24 {
25  vtkAxes * axes = vtkAxes::New();
26  axes->SetOrigin(0.,0.,0.);
27  axes->SetScaleFactor(1.);
28  polydata_->Delete();
29  polydata_ = axes->GetOutput();
30  vtkLookupTable * lut = vtkLookupTable::New();
31  lut->SetHueRange(0,1);
32  lut->SetSaturationRange(1,1);
33  lut->SetValueRange(1,1);
34 
35  vtkPolyDataMapper * map = vtkPolyDataMapper::New();
36  map->SetInputConnection(axes->GetOutputPort());
37  axes->Delete();
38  map->SetLookupTable(lut);
39  lut->Delete();
40 
41  actor_->Delete();
42  actor_ = vtkActor::New();
43  actor_->SetMapper(map);
44  map->Delete();
45  actor_->GetProperty()->SetInterpolationToFlat();
46  actor_->DragableOff();
47  this->logname();
48 }
49 //---------------------------------------------------------------------------
51 {
52 }
53 //---------------------------------------------------------------------------
54 const std::string a_axes::help()
55 {
56  std::ostringstream o;
57  o << "******" << std::endl;
58  o << "a_axes" << std::endl;
59  o << "******" << std::endl;
60  o << "The class derives from a_element." << std::endl;
61  o << "An object of this class represents a set of three perpendicular axes to be placed in a_canvas object" << std::endl;
62  o << "By default, the axes have a length of 1;" << std::endl;
63  o << "'x' is red, 'y' is green and 'z' is blue." << std::endl;
64  o << "Size, thickness and other parameters can be adjusted like any a_element." << std::endl;
65  o << a_element::help();
66  return o.str();
67 }
68 //---------------------------------------------------------------------------
70 {
72 }
73 //---------------------------------------------------------------------------
74 void a_axes::read(std::istream& in)
75 {
76 }
77 //---------------------------------------------------------------------------
78 void a_axes::write(std::ostream& o) const
79 {
80 }
static const std::string help()
Definition: a_axes.cxx:54
void reset()
Definition: a_axes.cxx:69
~a_axes()
Definition: a_axes.cxx:50
virtual void write(std::ostream &o) const
Definition: a_axes.cxx:78
virtual void read(std::istream &in)
Definition: a_axes.cxx:74
a_axes()
Definition: a_axes.cxx:23
layer used by screen to draw vector graphics
Definition: a_element.h:39
vtkPolyData * polydata_
Definition: a_element.h:125
void logname()
Definition: a_element.cxx:109
static const std::string help()
Definition: a_element.cxx:66
void reset()
Definition: a_element.cxx:168
vtkActor * actor_
Definition: a_element.h:124
std::istringstream in
Definition: ply2tri.cxx:32