#include "moab/Core.hpp"
#include <iostream>
#include <iomanip>
#include <cmath>
Go to the source code of this file.
◆ main()
- Examples
- mbex2.cpp.
Definition at line 27 of file mbex2.cpp.
47 std::cout <<
"Loaded a mesh containing: " << hex_range << std::endl;
63 std::cout << std::setw( 6 ) <<
"Handle" << std::setw( 10 ) <<
"X" << std::setw( 10 ) <<
"Y" << std::setw( 10 )
66 for( iter = connectivity.
begin(); iter != connectivity.
end(); ++iter )
72 std::cout << std::setw( 6 ) << *iter << std::setw( 10 ) << coord[0] << std::setw( 10 ) << coord[1]
73 << std::setw( 10 ) << coord[2] << std::endl;
86 "get_entities_by_type(VERTEX) failed" );
89 std::vector< double > vertex_coords( 3 * vertex_range.
size() );
93 const double PI = 3.14159265359;
94 const double ANGLE =
PI / 4;
95 for( iter = vertex_range.
begin(); iter != vertex_range.
end(); ++iter )
98 double x = vertex_coords[count + 0];
99 double y = vertex_coords[count + 1];
103 vertex_coords[count + 0] = x * std::cos( ANGLE ) - y * std::sin( ANGLE );
104 vertex_coords[count + 1] = x * std::sin( ANGLE ) + y * std::cos( ANGLE );
References moab::Range::begin(), moab::Range::end(), ErrorCode, moab::Interface::get_connectivity(), moab::Interface::get_coords(), moab::Interface::get_entities_by_type(), moab::Interface::load_file(), MB_CHK_SET_ERR, MBHEX, MBVERTEX, PI, moab::Interface::set_coords(), moab::Range::size(), and moab::Interface::write_file().