Points&Forces (survey)
Software tools facilitating the task of surveying architecture
test_a_block.cxx
Go to the documentation of this file.
1 /*
2 Copyright 2010-2011 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 <iostream>
17 #include <fstream>
18 #include "a_block_2d4.h"
19 
20 int main(int argc, char ** argv)
21 {
22  std::cerr << "test a_block" << std::endl;
23  a_block_2d4 b;
24  std::ifstream in("test_a_block.data");
25  if (!in) {std::cerr << "file does not exist" << std::endl; return -3;}
26  in >> b;
27  std::cout << b << std::endl;
28  in.close();
29  std::cout << "V: " << b.V() << std::endl;
30  std::cout << "c: " << b.c() << std::endl;
31  std::cout << "W: " << b.W() << std::endl;
32 }
double V() const
volume of the block
a_wrench W() const
weight wrench in world coordinate
Definition: a_block.cxx:178
a_point c() const
centre of mass (in world coordinate)
Definition: a_block.cxx:162
int main(int argc, char **argv)